mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Hide zoom button in toolbar when not zoomed
Hiding it via its alphaValue would allow the button to still respond to clicks…
This commit is contained in:
@ -178,7 +178,7 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
|||||||
if surfaceIsZoomed {
|
if surfaceIsZoomed {
|
||||||
guard let stackView = window?.tabGroup?.selectedWindow?.tab.accessoryView as? NSStackView else { return }
|
guard let stackView = window?.tabGroup?.selectedWindow?.tab.accessoryView as? NSStackView else { return }
|
||||||
|
|
||||||
var zoomButton: ZoomButtonView = ZoomButtonView(frame: NSRect(x: 0, y: 0, width: 20, height: 20), target: self, selector: #selector(splitZoom(_:)))
|
let zoomButton: ZoomButtonView = ZoomButtonView(frame: NSRect(x: 0, y: 0, width: 20, height: 20), target: self, selector: #selector(splitZoom(_:)))
|
||||||
|
|
||||||
zoomButton.translatesAutoresizingMaskIntoConstraints = false
|
zoomButton.translatesAutoresizingMaskIntoConstraints = false
|
||||||
zoomButton.widthAnchor.constraint(equalToConstant: 20).isActive = true
|
zoomButton.widthAnchor.constraint(equalToConstant: 20).isActive = true
|
||||||
@ -250,7 +250,7 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
|||||||
private func updateToolbarZoomButton() {
|
private func updateToolbarZoomButton() {
|
||||||
guard let itemView = window?.toolbar?.items.last?.view as? ZoomButtonView else { return }
|
guard let itemView = window?.toolbar?.items.last?.view as? ZoomButtonView else { return }
|
||||||
|
|
||||||
itemView.alphaValue = surfaceIsZoomed ? 1 : 0
|
itemView.isHidden = !surfaceIsZoomed
|
||||||
}
|
}
|
||||||
|
|
||||||
//MARK: - NSWindowController
|
//MARK: - NSWindowController
|
||||||
|
Reference in New Issue
Block a user