I have added a simple Help/About menu item to show an AboutDialog, but have experienced a very weird behavior. The first time I show the dialog it works as expected, but if I show it a second time it will not close. Being a modal dialog, this locks up the whole application.
Simple closure attached to action
let action = SimpleAction::new("help-about", None);
action.connect_activate(clone!(@weak window => move |_action, _parameter| {
show_help_about(&window);
}));
app.add_action(&action);
And the function to show is equally simple
pub fn show_help_about(window: &Window) {
let icon = Texture::from_resource(
"/com/shartrec/kelpie_planner/images/kelpiedog_120x120_transparent.png");
show_about_dialog(Some(window), &[
("program-name", &util::info::PROGRAM_NAME),
("version", &util::info::VERSION),
("website", &util::info::WEBSITE),
("license-type", &util::info::LICENSE_TYPE),
("title", &util::info::ABOUT_TITLE),
("authors", &[util::info::AUTHOR].as_ref()),
("logo", &icon)
]);
}