diff --git a/code/apps/Managed Software Center/Managed Software Center/Controllers/MainWindowController.swift b/code/apps/Managed Software Center/Managed Software Center/Controllers/MainWindowController.swift index a212d0cd..a625b371 100644 --- a/code/apps/Managed Software Center/Managed Software Center/Controllers/MainWindowController.swift +++ b/code/apps/Managed Software Center/Managed Software Center/Controllers/MainWindowController.swift @@ -78,7 +78,7 @@ class MainWindowController: NSWindowController, NSWindowDelegate, WKNavigationDe func currentPageIsUpdatesPage() -> Bool { // return true if current tab selected is Updates - return updatesToolbarItem.isEnabled + return toolBarItemIsHighlighted(updatesToolbarItem) } func alertToPendingUpdates() { @@ -148,6 +148,13 @@ class MainWindowController: NSWindowController, NSWindowDelegate, WKNavigationDe cached_self_service = SelfService() } + func toolBarItemIsHighlighted(_ item: NSToolbarItem) -> Bool { + if let button = item.view as? NSButton { + return (button.state == .on) + } + return false + } + func setHighlightFor(item: NSToolbarItem, doHighlight: Bool) { if let button = item.view as? NSButton { button.state = (doHighlight ? .on : .off)