aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorRubén Beltrán del Río <jj@r.bdr.sh>2026-03-27 11:17:28 +0100
committerRubén Beltrán del Río <jj@r.bdr.sh>2026-03-27 12:22:36 +0100
commit2bebe9de998ba8475c89c608254c76d63206a214 (patch)
tree53e91f5d8c02650d48f26215d020e534137966f0 /src/main.rs
parent1921e8c99d327518a4fd6fdb54928732bf21cd18 (diff)
Add about dialog
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index cd71c94..655462c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -94,6 +94,7 @@ relm4::new_stateless_action!(
);
relm4::new_stateless_action!(ZoomInAction, WindowActionGroup, "zoom-in");
relm4::new_stateless_action!(ZoomOutAction, WindowActionGroup, "zoom-out");
+relm4::new_stateless_action!(AboutAction, WindowActionGroup, "about");
relm4::new_stateless_action!(PreferencesAction, WindowActionGroup, "preferences");
struct NewFromTemplateAction;
@@ -133,6 +134,7 @@ struct AppModel {
preferences_window: Option<relm4::Controller<preferences::PreferencesWindow>>,
editor_css_provider: gtk::CssProvider,
horizontal_layout_enabled: bool,
+
// Child Components
header: Controller<Header>,
footer: Controller<Footer>,
@@ -432,6 +434,7 @@ impl SimpleComponent for AppModel {
SaveAsAction => Action::SaveAs { close_after: false }, &["<Primary><Shift>s"];
OpenAction => Action::Open, &["<Primary>o"];
CloseAction => Action::CloseWindow, &["<Primary>w"];
+ AboutAction => Action::OpenAboutDialog, &[];
PreferencesAction => Action::ShowPreferences, &["<Primary>comma"]
]);
let layout_action = register_action!(
@@ -591,6 +594,28 @@ impl SimpleComponent for AppModel {
}
Action::EnableHorizontalLayout => handlers::view::change_horizontal_layout(self, true),
+ Action::OpenAboutDialog => {
+ adw::AboutDialog::builder()
+ .developers(
+ env!("CARGO_PKG_AUTHORS")
+ .split(':')
+ .map(String::from)
+ .collect::<Vec<_>>(),
+ )
+ .comments(tr!("about.comment"))
+ .copyright("© 2026 Rubén Beltrán del Río")
+ .license_type(gtk::License::Agpl30)
+ .application_icon("systems.tranquil.Map")
+ .application_name(env!("CARGO_PKG_NAME"))
+ .version(env!("CARGO_PKG_VERSION"))
+ .website(env!("CARGO_PKG_HOMEPAGE"))
+ .issue_url("https://todo.sr.ht/~rbdr/wmap")
+ .support_url("mailto:wmap@r.bdr.sh")
+ .visible(true)
+ .build()
+ .present(Some(&self.window));
+ },
+
// Preferences
Action::ShowPreferences => handlers::preferences::show(self, &sender),
Action::PreferencesChanged(preferences) => {