diff --git a/src/main.rs b/src/main.rs index 3cfefa6..a924b7a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -658,6 +658,27 @@ impl egui_dock::TabViewer for TabViewer<'_> { )); } } + settings::WidgetKind::Button => { + ui.add_space(spacing); + let mut button = ui.button(&*setting.description); + if let Some(tooltip) = &setting.tooltip { + button = button.on_hover_text(&**tooltip); + } + if button.clicked() { + if let Err(e) = + runtime.invoke_settings_button(&setting.key) + { + self.state.timer.0.write().unwrap().log( + format!( + "{:?}", + e.context("Failed invoking settings button.") + ) + .into(), + LogType::Runtime(LogLevel::Error), + ); + } + } + } }); ui.end_row(); }