mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-20 06:20:32 +00:00
Refactor toggleMaximize to use notifications
This commit is contained in:
@@ -115,6 +115,11 @@ class BaseTerminalController: NSWindowController,
|
||||
selector: #selector(ghosttyCommandPaletteDidToggle(_:)),
|
||||
name: .ghosttyCommandPaletteDidToggle,
|
||||
object: nil)
|
||||
center.addObserver(
|
||||
self,
|
||||
selector: #selector(toggleMaximize),
|
||||
name: .ghosttyToggleMaximize,
|
||||
object: nil)
|
||||
|
||||
// Listen for local events that we need to know of outside of
|
||||
// single surface handlers.
|
||||
@@ -548,6 +553,11 @@ class BaseTerminalController: NSWindowController,
|
||||
window.performClose(sender)
|
||||
}
|
||||
|
||||
@IBAction func toggleMaximize(_ sender: Any) {
|
||||
guard let window = window else { return }
|
||||
window.zoom(self)
|
||||
}
|
||||
|
||||
@IBAction func splitRight(_ sender: Any) {
|
||||
guard let surface = focusedSurface?.surface else { return }
|
||||
ghostty.split(surface: surface, direction: GHOSTTY_SPLIT_DIRECTION_RIGHT)
|
||||
|
||||
Reference in New Issue
Block a user