mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: small stylistic edits
This commit is contained in:
@ -140,7 +140,7 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func fixTabBar() {
|
private func fixTabBar() {
|
||||||
// We do this to make sure that the tab bar will always re-composite. If we don't,
|
// We do this to make sure that the tab bar will always re-composite. If we don't,
|
||||||
// then the it will "drag" pieces of the background with it when a transparent
|
// then the it will "drag" pieces of the background with it when a transparent
|
||||||
// window is moved around.
|
// window is moved around.
|
||||||
|
@ -29,6 +29,7 @@ class TerminalWindow: NSWindow {
|
|||||||
|
|
||||||
private var windowButtonsBackdrop: NSView? = nil
|
private var windowButtonsBackdrop: NSView? = nil
|
||||||
private var windowDragHandle: WindowDragView? = nil
|
private var windowDragHandle: WindowDragView? = nil
|
||||||
|
private var storedTitlebarBackgroundColor: CGColor? = nil
|
||||||
|
|
||||||
// The tab bar controller ID from macOS
|
// The tab bar controller ID from macOS
|
||||||
static private let TabBarController = NSUserInterfaceItemIdentifier("_tabBarController")
|
static private let TabBarController = NSUserInterfaceItemIdentifier("_tabBarController")
|
||||||
@ -65,8 +66,6 @@ class TerminalWindow: NSWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var storedTitlebarBackgroundColor: CGColor? = nil
|
|
||||||
|
|
||||||
// Assign a background color to the titlebar area.
|
// Assign a background color to the titlebar area.
|
||||||
func setTitlebarBackground(_ color: CGColor) {
|
func setTitlebarBackground(_ color: CGColor) {
|
||||||
storedTitlebarBackgroundColor = color
|
storedTitlebarBackgroundColor = color
|
||||||
@ -80,9 +79,8 @@ class TerminalWindow: NSWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the titlebar has the assigned background color.
|
// Make sure the titlebar has the assigned background color.
|
||||||
func restoreTitlebarBackground() {
|
private func restoreTitlebarBackground() {
|
||||||
guard let color = storedTitlebarBackgroundColor else { return }
|
guard let color = storedTitlebarBackgroundColor else { return }
|
||||||
|
|
||||||
setTitlebarBackground(color)
|
setTitlebarBackground(color)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user