mirror of
https://github.com/lwouis/alt-tab-macos.git
synced 2026-05-24 11:20:36 +00:00
feat: add shortcut to toggle fullscreen selected window (closes #2521)
This commit is contained in:
@@ -26,6 +26,7 @@ class Preferences {
|
||||
"cancelShortcut": "⎋",
|
||||
"closeWindowShortcut": "W",
|
||||
"minDeminWindowShortcut": "M",
|
||||
"toggleFullscreenWindowShortcut": "F",
|
||||
"quitAppShortcut": "Q",
|
||||
"hideShowAppShortcut": "H",
|
||||
"arrowKeysEnabled": "true",
|
||||
@@ -115,6 +116,7 @@ class Preferences {
|
||||
static var cancelShortcut: String { defaults.string("cancelShortcut") }
|
||||
static var closeWindowShortcut: String { defaults.string("closeWindowShortcut") }
|
||||
static var minDeminWindowShortcut: String { defaults.string("minDeminWindowShortcut") }
|
||||
static var toggleFullscreenWindowShortcut: String { defaults.string("toggleFullscreenWindowShortcut") }
|
||||
static var quitAppShortcut: String { defaults.string("quitAppShortcut") }
|
||||
static var hideShowAppShortcut: String { defaults.string("hideShowAppShortcut") }
|
||||
static var arrowKeysEnabled: Bool { defaults.bool("arrowKeysEnabled") }
|
||||
|
||||
@@ -144,6 +144,10 @@ class App: AppCenterApplication, NSApplicationDelegate {
|
||||
Windows.focusedWindow()?.minDemin()
|
||||
}
|
||||
|
||||
func toggleFullscreenSelectedWindow() {
|
||||
Windows.focusedWindow()?.toggleFullscreen()
|
||||
}
|
||||
|
||||
func quitSelectedApp() {
|
||||
Windows.focusedWindow()?.application.quit()
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ class ControlsTab {
|
||||
"cancelShortcut": { App.app.hideUi() },
|
||||
"closeWindowShortcut": { App.app.closeSelectedWindow() },
|
||||
"minDeminWindowShortcut": { App.app.minDeminSelectedWindow() },
|
||||
"toggleFullscreenWindowShortcut": { App.app.toggleFullscreenSelectedWindow() },
|
||||
"quitAppShortcut": { App.app.quitSelectedApp() },
|
||||
"hideShowAppShortcut": { App.app.hideShowSelectedApp() },
|
||||
]
|
||||
@@ -35,6 +36,7 @@ class ControlsTab {
|
||||
let cancelShortcut = LabelAndControl.makeLabelWithRecorder(NSLocalizedString("Cancel and hide", comment: ""), "cancelShortcut", Preferences.cancelShortcut, labelPosition: .right)
|
||||
let closeWindowShortcut = LabelAndControl.makeLabelWithRecorder(NSLocalizedString("Close window", comment: ""), "closeWindowShortcut", Preferences.closeWindowShortcut, labelPosition: .right)
|
||||
let minDeminWindowShortcut = LabelAndControl.makeLabelWithRecorder(NSLocalizedString("Minimize/Deminimize window", comment: ""), "minDeminWindowShortcut", Preferences.minDeminWindowShortcut, labelPosition: .right)
|
||||
let toggleFullscreenWindowShortcut = LabelAndControl.makeLabelWithRecorder(NSLocalizedString("Fullscreen/Defullscreen window", comment: ""), "toggleFullscreenWindowShortcut", Preferences.toggleFullscreenWindowShortcut, labelPosition: .right)
|
||||
let quitAppShortcut = LabelAndControl.makeLabelWithRecorder(NSLocalizedString("Quit app", comment: ""), "quitAppShortcut", Preferences.quitAppShortcut, labelPosition: .right)
|
||||
let hideShowAppShortcut = LabelAndControl.makeLabelWithRecorder(NSLocalizedString("Hide/Show app", comment: ""), "hideShowAppShortcut", Preferences.hideShowAppShortcut, labelPosition: .right)
|
||||
let enableArrows = LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Arrow keys", comment: ""), "arrowKeysEnabled", extraAction: ControlsTab.arrowKeysEnabledCallback, labelPosition: .right)
|
||||
@@ -45,7 +47,7 @@ class ControlsTab {
|
||||
let selectWindowCheckboxes = StackView([StackView(enableArrows), StackView(enableMouse)], .vertical)
|
||||
let miscCheckboxesExplanations = LabelAndControl.makeLabel(NSLocalizedString("Miscellaneous:", comment: ""))
|
||||
let miscCheckboxes = StackView([StackView(enableCursorFollowFocus)], .vertical)
|
||||
let shortcuts = StackView([focusWindowShortcut, previousWindowShortcut, cancelShortcut, closeWindowShortcut, minDeminWindowShortcut, quitAppShortcut, hideShowAppShortcut].map { (view: [NSView]) in StackView(view) }, .vertical)
|
||||
let shortcuts = StackView([focusWindowShortcut, previousWindowShortcut, cancelShortcut, closeWindowShortcut, minDeminWindowShortcut, toggleFullscreenWindowShortcut, quitAppShortcut, hideShowAppShortcut].map { (view: [NSView]) in StackView(view) }, .vertical)
|
||||
let orPress = LabelAndControl.makeLabel(NSLocalizedString("While open, press:", comment: ""), shouldFit: false)
|
||||
let (holdShortcut, nextWindowShortcut, tab1View) = toShowSection(0)
|
||||
let (holdShortcut2, nextWindowShortcut2, tab2View) = toShowSection(1)
|
||||
|
||||
Reference in New Issue
Block a user