mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 14:00:29 +00:00
macOS: update window appearance based on preferredBackgroundColor
This commit is contained in:
@@ -143,6 +143,10 @@ class TitlebarTabsVenturaTerminalWindow: TerminalWindow {
|
||||
|
||||
override func syncAppearance(_ surfaceConfig: Ghostty.SurfaceView.DerivedConfig) {
|
||||
super.syncAppearance(surfaceConfig)
|
||||
// override appearance based on the terminal's background color
|
||||
if let preferredBackgroundColor {
|
||||
appearance = (preferredBackgroundColor.isLightColor ? NSAppearance(named: .aqua) : NSAppearance(named: .darkAqua))
|
||||
}
|
||||
|
||||
// Update our window light/darkness based on our updated background color
|
||||
let themeChanged = isLightTheme != OSColor(surfaceConfig.backgroundColor).isLightColor
|
||||
|
||||
@@ -59,6 +59,10 @@ class TransparentTitlebarTerminalWindow: TerminalWindow {
|
||||
|
||||
override func syncAppearance(_ surfaceConfig: Ghostty.SurfaceView.DerivedConfig) {
|
||||
super.syncAppearance(surfaceConfig)
|
||||
// override appearance based on the terminal's background color
|
||||
if let preferredBackgroundColor {
|
||||
appearance = (preferredBackgroundColor.isLightColor ? NSAppearance(named: .aqua) : NSAppearance(named: .darkAqua))
|
||||
}
|
||||
|
||||
// Save our config in case we need to reapply
|
||||
lastSurfaceConfig = surfaceConfig
|
||||
|
||||
Reference in New Issue
Block a user