mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Color after setting window theme and tab mode
This commit is contained in:
@ -259,13 +259,6 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
|||||||
// when cascading.
|
// when cascading.
|
||||||
window.center()
|
window.center()
|
||||||
|
|
||||||
// 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)
|
|
||||||
|
|
||||||
// Make sure our theme is set on the window so styling is correct.
|
// Make sure our theme is set on the window so styling is correct.
|
||||||
if let windowTheme = ghostty.config.windowTheme {
|
if let windowTheme = ghostty.config.windowTheme {
|
||||||
window.windowTheme = .init(rawValue: windowTheme)
|
window.windowTheme = .init(rawValue: windowTheme)
|
||||||
@ -282,6 +275,13 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
|
||||||
// Initialize our content view to the SwiftUI root
|
// Initialize our content view to the SwiftUI root
|
||||||
window.contentView = NSHostingView(rootView: TerminalView(
|
window.contentView = NSHostingView(rootView: TerminalView(
|
||||||
ghostty: self.ghostty,
|
ghostty: self.ghostty,
|
||||||
|
Reference in New Issue
Block a user