From 5619eb718ca42136da891e93ae4b512e73b6eb20 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 30 Oct 2020 23:12:35 -0700 Subject: [PATCH] wezterm: default inactive_pane_hsb to dim/desaturate Let's make the suggested config in the docs the default and dim/desaturate inactive panes slightly. --- config/src/lib.rs | 12 ++++++++++-- wezterm-gui/src/gui/termwindow.rs | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/config/src/lib.rs b/config/src/lib.rs index a26f0c847..b9aa30b3d 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -745,8 +745,8 @@ pub struct Config { /// A subtle dimming effect can be achieved by setting: /// inactive_pane_saturation = 0.9 /// inactive_pane_brightness = 0.8 - #[serde(default)] - pub inactive_pane_hsb: Option, + #[serde(default = "default_inactive_pane_hsb")] + pub inactive_pane_hsb: HsbTransform, #[serde(default = "default_one_point_oh")] pub text_background_opacity: f32, @@ -829,6 +829,14 @@ fn default_update_interval() -> u64 { 86400 } +fn default_inactive_pane_hsb() -> HsbTransform { + HsbTransform { + brightness: 0.8, + saturation: 0.9, + hue: 1.0, + } +} + #[derive(Deserialize, Serialize, Clone, Copy, Debug)] pub enum DefaultCursorStyle { BlinkingBlock, diff --git a/wezterm-gui/src/gui/termwindow.rs b/wezterm-gui/src/gui/termwindow.rs index f3c2a45ea..107016b35 100644 --- a/wezterm-gui/src/gui/termwindow.rs +++ b/wezterm-gui/src/gui/termwindow.rs @@ -2674,7 +2674,7 @@ impl TermWindow { let hsv = if params.is_active { None } else { - params.config.inactive_pane_hsb + Some(params.config.inactive_pane_hsb) }; let window_is_transparent =