summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty/src/display/window.rs8
-rw-r--r--alacritty/src/window_context.rs3
3 files changed, 10 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a0af3b07..e4aac6d4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -52,6 +52,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Scrolling on touchscreens
- Double clicking on CSD titlebar not always maximizing a window on Wayland
- Excessive memory usage when using regexes with a large number of possible states
+- `window.decorations_theme_variant` not live reloading
### Removed
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.)