Skip to content

Commit

Permalink
feat: add menu option to pop up the selector window
Browse files Browse the repository at this point in the history
  • Loading branch information
akx authored and lwouis committed Jan 3, 2020
1 parent de7f428 commit 78428dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions alt-tab-macos/ui/Application.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ class Application: NSApplication, NSApplicationDelegate, NSWindowDelegate {
Screen.showPanel(preferencesPanel!, Screen.preferred(), .appleCentered)
}

@objc
func showUi() {
showUiOrCycleSelection(0)
}

func cycleSelection(_ step: Int) {
TrackedWindows.focusedWindowIndex = TrackedWindows.moveFocusedWindowIndex(step)
self.thumbnailsPanel!.highlightCellAt(step)
Expand Down
5 changes: 5 additions & 0 deletions alt-tab-macos/ui/StatusItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ class StatusItem {
withTitle: "Preferences…",
action: #selector(application.showPreferencesPanel),
keyEquivalent: ",")
item.menu!.addItem(
withTitle: "Show…",
action: #selector(application.showUi),
keyEquivalent: "s"
)
item.menu!.addItem(
withTitle: "Quit \(Application.name) #VERSION#",
action: #selector(NSApplication.terminate(_:)),
Expand Down

0 comments on commit 78428dc

Please sign in to comment.