Implement configuration option split-divider-color for macOS

This commit is contained in:
Christian Schneider
2025-01-04 23:49:27 +01:00
committed by Mitchell Hashimoto
parent 0df4012edc
commit da80531c22
2 changed files with 16 additions and 3 deletions

View File

@ -381,7 +381,20 @@ extension Ghostty {
let backgroundColor = OSColor(backgroundColor)
let isLightBackground = backgroundColor.isLightColor
let newColor = isLightBackground ? backgroundColor.darken(by: 0.08) : backgroundColor.darken(by: 0.4)
return Color(newColor)
guard let config = self.config else { return Color(newColor) }
var color: ghostty_config_color_s = .init();
let key = "split-divider-color"
if (!ghostty_config_get(config, &color, key, UInt(key.count))) {
return Color(newColor)
}
return .init(
red: Double(color.r) / 255,
green: Double(color.g) / 255,
blue: Double(color.b) / 255
)
}
#if canImport(AppKit)

View File

@ -610,8 +610,8 @@ palette: Palette = .{},
/// Specified as either hex (`#RRGGBB` or `RRGGBB`) or a named X11 color.
@"unfocused-split-fill": ?Color = null,
/// The color of the divider between splits. If unset the default system color
/// will be used. GTK only.
/// The color of the split divider. If this is not set, a default will be chosen.
/// Specified as either hex (`#RRGGBB` or `RRGGBB`) or a named X11 color.
@"split-divider-color": ?Color = null,
/// The command to run, usually a shell. If this is not an absolute path, it'll