File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
iced_sessionlock/src/multi_window Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -443,6 +443,8 @@ where
443443 . copied ( )
444444 . unwrap_or_else ( IcedId :: unique) ;
445445
446+ let is_first = self . window_manager . is_empty ( ) ;
447+
446448 let window = self . window_manager . insert (
447449 iced_id,
448450 ( width, height) ,
@@ -455,6 +457,20 @@ where
455457 self . system_theme ,
456458 ) ;
457459
460+ iced_debug:: theme_changed ( || {
461+ if is_first {
462+ theme:: Base :: palette ( window. state . theme ( ) )
463+ } else {
464+ None
465+ }
466+ } ) ;
467+
468+ let theme = window. state . theme ( ) . mode ( ) ;
469+ if self . system_theme != theme {
470+ self . runtime
471+ . broadcast ( iced_futures:: subscription:: Event :: SystemThemeChanged ( theme) ) ;
472+ }
473+
458474 self . user_interfaces . build (
459475 iced_id,
460476 user_interface:: Cache :: default ( ) ,
Original file line number Diff line number Diff line change 5757 . map ( iced_core:: theme:: Base :: mode)
5858 . unwrap_or_default ( ) ;
5959 let default_theme = <P :: Theme as iced_core:: theme:: Base >:: default ( system_theme) ;
60- let style = application. style ( & default_theme) ;
60+ let style = application. style ( & theme . as_ref ( ) . unwrap_or ( & default_theme) ) ;
6161
6262 let window_size = Size :: new ( width, height) ;
6363 let viewport = viewport ( window_size, wayland_scale_factor, application_scale_factor) ;
Original file line number Diff line number Diff line change 4949 . map ( iced_core:: theme:: Base :: mode)
5050 . unwrap_or_default ( ) ;
5151 let default_theme = <P :: Theme as iced_core:: theme:: Base >:: default ( system_theme) ;
52- let style = application. style ( & default_theme) ;
52+ let style = application. style ( & theme . as_ref ( ) . unwrap_or ( & default_theme) ) ;
5353
5454 let window_size = Size :: new ( width, height) ;
5555 let viewport = viewport ( window_size, wayland_scale_factor, application_scale_factor) ;
You can’t perform that action at this time.
0 commit comments