1
1
mirror of https://github.com/bitgapp/eqMac.git synced 2024-11-26 16:05:52 +03:00

fixing UI mode depending on Icon Mode

This commit is contained in:
Nodeful 2021-07-12 00:37:05 +03:00
parent e7371339f2
commit 7b69dd4a20

View File

@ -37,6 +37,17 @@ class Settings: StoreSubscriber {
NSApp.setActivationPolicy(showDockIcon ? .regular : .accessory)
let showStatusBarIcon = self.iconMode == .both || self.iconMode == .statusBar
UI.statusItem.item.isVisible = showStatusBarIcon
let beforeWasInDock = oldValue == .both || oldValue == .dock
if (beforeWasInDock && !showDockIcon) {
// Means the dock icon has dissappeared and window would close
UI.show()
}
if (!showStatusBarIcon && Application.store.state.ui.mode == .popover) {
// Popover has nothing to attach to so need to go into Window mode
Application.dispatchAction(UIAction.setMode(.window))
}
}
}