mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-05 19:08:17 +00:00
feat: implement toggleMaximize for macOS
This commit is contained in:
@@ -807,6 +807,12 @@ class AppDelegate: NSObject,
|
||||
setSecureInput(.toggle)
|
||||
}
|
||||
|
||||
@IBAction func toggleMaximize(_ sender: Any) {
|
||||
if NSApp.isActive, let keyWindow = NSApp.keyWindow {
|
||||
keyWindow.zoom(self)
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func toggleQuickTerminal(_ sender: Any) {
|
||||
if quickController == nil {
|
||||
quickController = QuickTerminalController(
|
||||
|
@@ -29,7 +29,6 @@ struct TerminalCommandPaletteView: View {
|
||||
let key = String(cString: c.action_key)
|
||||
switch (key) {
|
||||
case "toggle_tab_overview",
|
||||
"toggle_maximize",
|
||||
"toggle_window_decorations":
|
||||
return false
|
||||
default:
|
||||
|
@@ -523,6 +523,9 @@ extension Ghostty {
|
||||
case GHOSTTY_ACTION_TOGGLE_COMMAND_PALETTE:
|
||||
toggleCommandPalette(app, target: target)
|
||||
|
||||
case GHOSTTY_ACTION_TOGGLE_MAXIMIZE:
|
||||
toggleMaximize(app, target: target)
|
||||
|
||||
case GHOSTTY_ACTION_TOGGLE_QUICK_TERMINAL:
|
||||
toggleQuickTerminal(app, target: target)
|
||||
|
||||
@@ -767,6 +770,14 @@ extension Ghostty {
|
||||
}
|
||||
}
|
||||
|
||||
private static func toggleMaximize(
|
||||
_ app: ghostty_app_t,
|
||||
target: ghostty_target_s
|
||||
) {
|
||||
guard let appDelegate = NSApplication.shared.delegate as? AppDelegate else { return }
|
||||
appDelegate.toggleMaximize(self)
|
||||
}
|
||||
|
||||
private static func toggleVisibility(
|
||||
_ app: ghostty_app_t,
|
||||
target: ghostty_target_s
|
||||
|
Reference in New Issue
Block a user