INNER CODE UNIT · Swift
updateMenuBarStatusItemForActiveState
mjrusso/scoot · Scoot/AppDelegate.swift:287
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))")
let activeJumpMode = self.inputWindow.activeJumpMode
if let app = self.currentApp , activeJumpMode == .element {
// For performance reasons, only traverse the accessibility tree if
// the user is actually using the element-based navigation mode.