win32: refresh title bar on Window::set_theme

This commit is contained in:
Tony
2025-08-23 20:55:54 +08:00
committed by GitHub
parent 317d62fb93
commit a4af50ec13
4 changed files with 37 additions and 12 deletions

View File

@@ -1099,7 +1099,7 @@ impl CoreWindow for Window {
}
fn set_theme(&self, theme: Option<Theme>) {
try_theme(self.window.hwnd(), theme);
self.window_state_lock().current_theme = try_theme(self.window.hwnd(), theme, true);
}
fn theme(&self) -> Option<Theme> {
@@ -1196,7 +1196,7 @@ impl InitData<'_> {
// If the system theme is dark, we need to set the window theme now
// before we update the window flags (and possibly show the
// window for the first time).
let current_theme = try_theme(window, self.attributes.preferred_theme);
let current_theme = try_theme(window, self.attributes.preferred_theme, false);
let window_state = {
let window_state = WindowState::new(