Broadcast potential theme changes on window creation
This commit is contained in:
parent
a9091f9edd
commit
04f53b5f62
1 changed files with 14 additions and 0 deletions
|
|
@ -647,6 +647,20 @@ async fn run_instance<P>(
|
||||||
system_theme,
|
system_theme,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let window_theme = window
|
||||||
|
.raw
|
||||||
|
.theme()
|
||||||
|
.map(conversion::theme_mode)
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
|
if system_theme != window_theme {
|
||||||
|
system_theme = window_theme;
|
||||||
|
|
||||||
|
runtime.broadcast(subscription::Event::SystemThemeChanged(
|
||||||
|
window_theme,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
window.raw.set_theme(conversion::window_theme(
|
window.raw.set_theme(conversion::window_theme(
|
||||||
window.state.theme_mode(),
|
window.state.theme_mode(),
|
||||||
));
|
));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue