Apply feedback

This commit is contained in:
Matt Robenolt
2023-12-12 17:01:50 -08:00
parent 8e607f372b
commit 91937c4ada
3 changed files with 10 additions and 17 deletions

View File

@ -60,30 +60,22 @@ extension Ghostty {
var opacity: Double = 0.85
let key = "unfocused-split-opacity"
_ = ghostty_config_get(ghostty.config, &opacity, key, UInt(key.count))
AppDelegate.logger.warning("ghostty_config_get(\(key))=\(opacity)")
return 1 - opacity
}
// The color for the rectable overlay when unfocused.
private var unfocusedFill: Color {
var rgb: UInt32 = 16777215 // white default
let key = "unfocused-split-fill"
_ = ghostty_config_get(ghostty.config, &rgb, key, UInt(key.count))
AppDelegate.logger.warning("ghostty_config_get(\(key))=\(rgb)")
let red = Double((rgb >> 16) & 0xff)
let green = Double((rgb >> 8) & 0xff)
let blue = Double(rgb & 0xff)
AppDelegate.logger.warning("red=\(red) green=\(green) blue=\(blue)")
return Color.init(
red: 255,
green: 0,
blue: 0
return Color(
red: red / 255,
green: green / 255,
blue: blue / 255
)
// return Color.init(
// red: red,
// green: green,
// blue: blue,
// opacity: unfocusedOpacity
// )
}
var body: some View {

View File

@ -314,7 +314,8 @@ palette: Palette = .{},
/// clamped to the nearest valid value.
@"unfocused-split-opacity": f64 = 0.85,
@"unfocused-split-fill": ?Color = null,
// The color to dim the unfocused split.
@"unfocused-split-fill": Color = Color{ .r = 255, .g = 255, .b = 255 },
/// The command to run, usually a shell. If this is not an absolute path,
/// it'll be looked up in the PATH. If this is not set, a default will

View File

@ -39,9 +39,9 @@ pub fn get(config: *const Config, k: Key, ptr_raw: *anyopaque) bool {
ptr.* = @floatCast(value);
},
?Color => {
const ptr: *?c_uint = @ptrCast(@alignCast(ptr_raw));
ptr.* = if (value) |c| c.toInt() else null;
Color => {
const ptr: *c_uint = @ptrCast(@alignCast(ptr_raw));
ptr.* = value.toInt();
},
else => |T| switch (@typeInfo(T)) {