|
|
@ -113,7 +113,7 @@ impl WrapApp { |
|
|
|
// A menu-bar is a horizontal layout with some special styles applied.
|
|
|
|
// egui::menu::bar(ui, |ui| {
|
|
|
|
ui.horizontal_wrapped(|ui| { |
|
|
|
dark_light_mode_switch(ui); |
|
|
|
egui::widgets::global_dark_light_mode_switch(ui); |
|
|
|
|
|
|
|
ui.checkbox(&mut self.backend_panel.open, "💻 Backend"); |
|
|
|
ui.separator(); |
|
|
@ -222,12 +222,3 @@ fn clock_button(ui: &mut egui::Ui, seconds_since_midnight: f64) -> egui::Respons |
|
|
|
|
|
|
|
ui.add(egui::Button::new(time).text_style(egui::TextStyle::Monospace)) |
|
|
|
} |
|
|
|
|
|
|
|
/// Show a button to switch to/from dark/light mode (globally).
|
|
|
|
fn dark_light_mode_switch(ui: &mut egui::Ui) { |
|
|
|
let style: egui::Style = (*ui.ctx().style()).clone(); |
|
|
|
let new_visuals = style.visuals.light_dark_small_toggle_button(ui); |
|
|
|
if let Some(visuals) = new_visuals { |
|
|
|
ui.ctx().set_visuals(visuals); |
|
|
|
} |
|
|
|
} |
|
|
|