INNER CODE UNIT · Swift
updateMenuBarStatusItemForInactiveState
mjrusso/scoot · Scoot/AppDelegate.swift:281
func updateMenuBarStatusItemForInactiveState() {
self.statusItem?.button?.image = isProcessTrustedForAccessibilityAccess ?
menuBarStatusItemOutlinedImage :
menuBarStatusItemOutlinedImage?.withTintColor(.systemRed)
}
func updateMenuBarStatusItemForActiveState() {
self.statusItem?.button?.image = isProcessTrustedForAccessibilityAccess ?
menuBarStatusItemFilledImage :
menuBarStatusItemFilledImage?.withTintColor(.systemRed)
}
// MARK: Activation
func bringToForeground() {
self.currentApp = NSWorkspace.shared.frontmostApplication
OSLog.main.log("Scoot invoked with frontmost app: \(String(describing: self.currentApp?.localizedName ?? "<unknown>"), privacy: .private(mask: .hash))")