@@ -201,7 +201,7 @@ impl DemoApp {
201201 events_buf,
202202 #[ cfg( feature = "events" ) ]
203203 event_filters : EventFilters :: default ( ) ,
204- dark_mode : cc. egui_ctx . style ( ) . visuals . dark_mode ,
204+ dark_mode : cc. egui_ctx . global_style ( ) . visuals . dark_mode ,
205205 show_debug_overlay : true ,
206206 show_keybindings_overlay : false ,
207207 keybindings_just_opened : false ,
@@ -450,7 +450,7 @@ impl DemoApp {
450450 egui_graphs:: reset :: < FruchtermanReingoldWithCenterGravityState > ( ui, None ) ;
451451 egui_graphs:: reset :: < LayoutStateHierarchical > ( ui, None ) ;
452452 ui. ctx ( ) . set_visuals ( egui:: Visuals :: dark ( ) ) ;
453- self . dark_mode = ui. ctx ( ) . style ( ) . visuals . dark_mode ;
453+ self . dark_mode = ui. ctx ( ) . global_style ( ) . visuals . dark_mode ;
454454 #[ cfg( feature = "events" ) ]
455455 {
456456 self . last_events . clear ( ) ;
@@ -910,7 +910,7 @@ impl DemoApp {
910910 pub fn ui_style ( & mut self , ui : & mut Ui ) {
911911 CollapsingHeader :: new ( "Style" ) . show ( ui, |ui| {
912912 ui. horizontal ( |ui| {
913- let mut dark = ui. ctx ( ) . style ( ) . visuals . dark_mode ;
913+ let mut dark = ui. ctx ( ) . global_style ( ) . visuals . dark_mode ;
914914 if ui
915915 . checkbox ( & mut dark, "dark mode" )
916916 . on_hover_text ( "Toggle dark or light visuals" )
@@ -1154,21 +1154,21 @@ impl DemoApp {
11541154}
11551155
11561156impl App for DemoApp {
1157- fn update ( & mut self , ctx : & egui :: Context , _frame : & mut eframe:: Frame ) {
1157+ fn ui ( & mut self , ui : & mut Ui , _ : & mut eframe:: Frame ) {
11581158 // Reset typing flag each frame; UI code will set it when a text field has focus
11591159 self . typing_in_input = false ;
11601160 // Sync counts displayed on sliders with actual graph values
11611161 self . sync_counts ( ) ;
11621162
11631163 // Handle global keyboard shortcuts and modal toggling
1164- self . process_keybindings ( ctx) ;
1164+ self . process_keybindings ( ui . ctx ( ) ) ;
11651165
11661166 // Right side panel with controls
11671167 if self . show_sidebar {
1168- egui:: SidePanel :: right ( "right" )
1169- . default_width ( SIDE_PANEL_WIDTH )
1170- . min_width ( SIDE_PANEL_WIDTH )
1171- . show ( ctx , |ui| {
1168+ egui:: Panel :: right ( "right" )
1169+ . default_size ( SIDE_PANEL_WIDTH )
1170+ . min_size ( SIDE_PANEL_WIDTH )
1171+ . show_inside ( ui , |ui| {
11721172 // Tabs header using selectable labels
11731173 ui. horizontal ( |ui| {
11741174 ui. selectable_value (
@@ -1189,7 +1189,7 @@ impl App for DemoApp {
11891189 }
11901190
11911191 // Central graph view
1192- egui:: CentralPanel :: default ( ) . show ( ctx , |ui| {
1192+ egui:: CentralPanel :: default ( ) . show_inside ( ui , |ui| {
11931193 if self . reset_requested {
11941194 self . reset_all ( ui) ;
11951195 self . reset_requested = false ;
@@ -1199,12 +1199,12 @@ impl App for DemoApp {
11991199 // Detect if any file is being dragged over the app. Some platforms/browsers
12001200 // don't provide a pointer position during file drags, so don't require it.
12011201 // We draw the overlay only within the CentralPanel rect anyway.
1202- self . drag_hover_graph = ctx. input ( |i| !i. raw . hovered_files . is_empty ( ) ) ;
1202+ self . drag_hover_graph = ui . ctx ( ) . input ( |i| !i. raw . hovered_files . is_empty ( ) ) ;
12031203
12041204 // Handle drops this frame (platform may provide bytes immediately or later). Process the first valid one.
12051205 let mut maybe_text: Option < String > = None ;
12061206 let mut maybe_name: Option < String > = None ;
1207- ctx. input ( |i| {
1207+ ui . ctx ( ) . input ( |i| {
12081208 for f in & i. raw . dropped_files {
12091209 if let Some ( bytes) = & f. bytes {
12101210 if let Ok ( s) = std:: str:: from_utf8 ( bytes) {
@@ -1567,7 +1567,7 @@ impl App for DemoApp {
15671567 self . update_fps ( ) ;
15681568
15691569 // Draw modal after main UI
1570- self . keybindings_modal ( ctx) ;
1570+ self . keybindings_modal ( ui . ctx ( ) ) ;
15711571 }
15721572}
15731573
@@ -1845,7 +1845,7 @@ impl DemoApp {
18451845 }
18461846
18471847 // Other keybindings (still disabled while typing to avoid graph actions while editing text)
1848- let typing = self . typing_in_input || ctx. wants_keyboard_input ( ) ;
1848+ let typing = self . typing_in_input || ctx. egui_wants_keyboard_input ( ) ;
18491849 let cmds = if typing {
18501850 Vec :: new ( )
18511851 } else {
0 commit comments