feat: add menu option to pop up the selector window

This commit is contained in:
Aarni Koskela authored and lwouis committed 2020-01-03 20:18:31 +09:00
1 parent de7f428ba1
commit 78428dc309
2 files changed
+10

No files matched your search

+5
View File
@@ -64,6 +64,11 @@ class Application: NSApplication, NSApplicationDelegate, NSWindowDelegate {
Screen.showPanel(preferencesPanel!, Screen.preferred(), .appleCentered) Screen.showPanel(preferencesPanel!, Screen.preferred(), .appleCentered)
} }
@objc
func showUi() {
showUiOrCycleSelection(0)
}
func cycleSelection(_ step: Int) { func cycleSelection(_ step: Int) {
TrackedWindows.focusedWindowIndex = TrackedWindows.moveFocusedWindowIndex(step) TrackedWindows.focusedWindowIndex = TrackedWindows.moveFocusedWindowIndex(step)
self.thumbnailsPanel!.highlightCellAt(step) self.thumbnailsPanel!.highlightCellAt(step)
+5
View File
@@ -9,6 +9,11 @@ class StatusItem {
withTitle: "Preferences…", withTitle: "Preferences…",
action: #selector(application.showPreferencesPanel), action: #selector(application.showPreferencesPanel),
keyEquivalent: ",") keyEquivalent: ",")
item.menu!.addItem(
withTitle: "Show…",
action: #selector(application.showUi),
keyEquivalent: "s"
)
item.menu!.addItem( item.menu!.addItem(
withTitle: "Quit \(Application.name) #VERSION#", withTitle: "Quit \(Application.name) #VERSION#",
action: #selector(NSApplication.terminate(_:)), action: #selector(NSApplication.terminate(_:)),