From 7ceb638ff80eca99ac63df5fd8cbb2f703d4637a Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Sun, 15 Oct 2023 05:37:58 +0400 Subject: Fix `window.decorations_theme_variant` reload The live reload handling wasn't introduced when the option got added. Fixes #7295. --- alacritty/src/display/window.rs | 8 ++++++-- alacritty/src/window_context.rs | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'alacritty/src') diff --git a/alacritty/src/display/window.rs b/alacritty/src/display/window.rs index aef6e1b5..afa5a181 100644 --- a/alacritty/src/display/window.rs +++ b/alacritty/src/display/window.rs @@ -35,8 +35,8 @@ use winit::monitor::MonitorHandle; use winit::platform::windows::IconExtWindows; use winit::window::raw_window_handle::{HasRawWindowHandle, RawWindowHandle}; use winit::window::{ - CursorIcon, Fullscreen, ImePurpose, UserAttentionType, Window as WinitWindow, WindowBuilder, - WindowId, + CursorIcon, Fullscreen, ImePurpose, Theme, UserAttentionType, Window as WinitWindow, + WindowBuilder, WindowId, }; use alacritty_terminal::index::Point; @@ -374,6 +374,10 @@ impl Window { self.window.pre_present_notify(); } + pub fn set_theme(&self, theme: Option) { + self.window.set_theme(theme); + } + #[cfg(target_os = "macos")] pub fn toggle_simple_fullscreen(&self) { self.set_simple_fullscreen(!self.window.simple_fullscreen()); diff --git a/alacritty/src/window_context.rs b/alacritty/src/window_context.rs index 6a536ca4..ed384e4c 100644 --- a/alacritty/src/window_context.rs +++ b/alacritty/src/window_context.rs @@ -303,6 +303,9 @@ impl WindowContext { self.display.pending_update.set_font(font); } + // Always reload the theme to account for auto-theme switching. + self.display.window.set_theme(self.config.window.decorations_theme_variant); + // Update display if either padding options or resize increments were changed. let window_config = &old_config.window; if window_config.padding(1.) != self.config.window.padding(1.) -- cgit