From c24d7dfd0d2d8849f0398d7cb1a65d6562ee7a0d Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Mon, 16 Aug 2021 14:49:14 +0300 Subject: Add option to apply opacity to all background colors In some cases it could be desired to apply 'background_opacity' to all background colors instead of just 'colors.primary.background', thus adding an 'colors.opaque_background_colors' option to control that. Fixes #741. --- alacritty/src/config/ui_config.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'alacritty/src/config/ui_config.rs') diff --git a/alacritty/src/config/ui_config.rs b/alacritty/src/config/ui_config.rs index cf0f9298..f0917cf5 100644 --- a/alacritty/src/config/ui_config.rs +++ b/alacritty/src/config/ui_config.rs @@ -69,7 +69,8 @@ pub struct UiConfig { mouse_bindings: MouseBindings, /// Background opacity from 0.0 to 1.0. - background_opacity: Percentage, + #[config(deprecated = "use window.opacity instead")] + window_opacity: Option, } impl Default for UiConfig { @@ -84,7 +85,7 @@ impl Default for UiConfig { config_paths: Default::default(), key_bindings: Default::default(), mouse_bindings: Default::default(), - background_opacity: Default::default(), + window_opacity: Default::default(), bell: Default::default(), colors: Default::default(), draw_bold_text_with_bright_colors: Default::default(), @@ -115,8 +116,8 @@ impl UiConfig { } #[inline] - pub fn background_opacity(&self) -> f32 { - self.background_opacity.as_f32() + pub fn window_opacity(&self) -> f32 { + self.window_opacity.unwrap_or(self.window.opacity).as_f32() } #[inline] -- cgit