From 2bebe9de998ba8475c89c608254c76d63206a214 Mon Sep 17 00:00:00 2001 From: Rubén Beltrán del Río Date: Fri, 27 Mar 2026 11:17:28 +0100 Subject: Add about dialog --- src/actions.rs | 3 +++ src/components/header.rs | 7 +++++++ src/main.rs | 25 +++++++++++++++++++++++++ 3 files changed, 35 insertions(+) (limited to 'src') diff --git a/src/actions.rs b/src/actions.rs index 33289b1..09b7d4b 100644 --- a/src/actions.rs +++ b/src/actions.rs @@ -65,6 +65,9 @@ pub enum Action { DisableHorizontalLayout, EnableHorizontalLayout, + // Help and About + OpenAboutDialog, + // Preferences ShowPreferences, PreferencesChanged(UserPreferences), diff --git a/src/components/header.rs b/src/components/header.rs index 6c1055b..7977a5b 100644 --- a/src/components/header.rs +++ b/src/components/header.rs @@ -184,6 +184,13 @@ impl Header { zoom_section.append(Some(&tr!("command.view.zoom_out")), Some("window.zoom-out")); main_menu.append_section(None, &zoom_section); + let help_section = gio::Menu::new(); + help_section.append( + Some(&tr!("command.application.about")), + Some("window.about"), + ); + main_menu.append_section(None, &help_section); + let prefs_section = gio::Menu::new(); prefs_section.append( Some(&tr!("command.application.preferences")), 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>, editor_css_provider: gtk::CssProvider, horizontal_layout_enabled: bool, + // Child Components header: Controller
, footer: Controller