diff --git a/src/main.rs b/src/main.rs index ccc2c18..abceea6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,6 +22,35 @@ impl Default for AboutDialog { } } +impl Component for AboutDialog { + type Message = (); + type Properties = (); + + fn view(&self) -> VNode { + gtk! { + , + DialogFlags::MODAL, + &[("Ok", ResponseType::Ok)] + )> + + + + + } + } +} + +impl AboutDialog { + #[allow(unused_must_use)] + fn run() { + vgtk::run_dialog::(vgtk::current_window().as_ref()); + } +} + #[derive(Clone, Debug, Default)] pub struct Radio { pub labels: &'static [&'static str], @@ -203,7 +232,10 @@ impl Component for Model { self.tasks.retain(|task| !task.done); UpdateAction::Render } - Message::About => UpdateAction::None, + Message::About => { + AboutDialog::run(); + UpdateAction::None + } } }