diff options
Diffstat (limited to 'alacritty/src')
-rw-r--r-- | alacritty/src/display/window.rs | 8 | ||||
-rw-r--r-- | alacritty/src/window_context.rs | 3 |
2 files changed, 9 insertions, 2 deletions
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<Theme>) { + 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.) |