Avoid coloring when using native tabs

This commit is contained in:
Troels Thomsen
2024-05-21 08:58:51 +02:00
parent 47874742a1
commit f79674097f

View File

@ -173,6 +173,8 @@ class TerminalController: NSWindowController, NSWindowDelegate,
window.titlebarFont = nil
}
guard window.hasStyledTabs else { return }
// The titlebar is always updated. We don't need to worry about opacity
// because we handle it here.
let backgroundColor = OSColor(ghostty.config.backgroundColor)
@ -275,12 +277,14 @@ class TerminalController: NSWindowController, NSWindowDelegate,
}
}
// Set the background color of the window
let backgroundColor = NSColor(ghostty.config.backgroundColor)
window.backgroundColor = backgroundColor
if window.hasStyledTabs {
// Set the background color of the window
let backgroundColor = NSColor(ghostty.config.backgroundColor)
window.backgroundColor = backgroundColor
// This makes sure our titlebar renders correctly when there is a transparent background
window.titlebarColor = backgroundColor.withAlphaComponent(ghostty.config.backgroundOpacity)
// This makes sure our titlebar renders correctly when there is a transparent background
window.titlebarColor = backgroundColor.withAlphaComponent(ghostty.config.backgroundOpacity)
}
// Initialize our content view to the SwiftUI root
window.contentView = NSHostingView(rootView: TerminalView(