From 1339816ded9932d6bd256bd88ca5b87afc4eb4c6 Mon Sep 17 00:00:00 2001 From: lainsce Date: Sat, 10 Feb 2024 13:21:34 -0300 Subject: [PATCH] Impl better main menu --- data/io.github.lainsce.Notejot.gresource.xml | 1 + data/meson.build | 1 + data/ui/main_menu.blp | 60 ++++++++++++++++++ data/ui/main_window.ui | 64 +------------------- data/ui/note_theme.blp | 7 ++- meson.build | 3 +- src/MainWindow.vala | 10 ++- src/Widgets/MainMenu.vala | 25 ++++++++ 8 files changed, 104 insertions(+), 67 deletions(-) create mode 100644 data/ui/main_menu.blp create mode 100644 src/Widgets/MainMenu.vala diff --git a/data/io.github.lainsce.Notejot.gresource.xml b/data/io.github.lainsce.Notejot.gresource.xml index e81abab..56fd3b1 100644 --- a/data/io.github.lainsce.Notejot.gresource.xml +++ b/data/io.github.lainsce.Notejot.gresource.xml @@ -6,6 +6,7 @@ ui/edit_notebooks.ui ui/move_to_dialog.ui ui/main_window.ui + ui/main_menu.ui ui/note_theme.ui ui/notecontentview.ui ui/notelistview.ui diff --git a/data/meson.build b/data/meson.build index 79acc7d..af001a4 100644 --- a/data/meson.build +++ b/data/meson.build @@ -60,6 +60,7 @@ blueprints = custom_target( 'blueprints', input: files( 'ui/edit_notebooks.blp', + 'ui/main_menu.blp', 'ui/move_to_dialog.blp', 'ui/note_theme.blp', 'ui/notebooklistview.blp', diff --git a/data/ui/main_menu.blp b/data/ui/main_menu.blp new file mode 100644 index 0000000..d28729e --- /dev/null +++ b/data/ui/main_menu.blp @@ -0,0 +1,60 @@ +using Gtk 4.0; +using He 1; + +template $NotejotWidgetsMainMenu : Box { + orientation: vertical; + styles [ + "notejot-theme", + ] + + Box { + orientation: vertical; + spacing: 6; + margin-start: 6; + margin-end: 10; + + Label { + label: _('Font Size'); + halign: start; + styles [ + "caption", + "dim-label", + ] + } + + He.SegmentedButton { + ToggleButton s { + label: 'Small'; + action-name: 'app.font-size'; + action-target: '"\'small\'"'; + } + + ToggleButton { + label: 'Medium'; + action-name: 'app.font-size'; + action-target: '"\'medium\'"'; + group: s; + } + + ToggleButton { + label: 'Large'; + action-name: 'app.font-size'; + action-target: '"\'large\'"'; + group: s; + } + } + } + + He.Divider { + } + + He.TextButton about_button { + hexpand: true; + action-name: 'win.action_about'; + child: + He.ButtonContent { + icon: "dialog-information-symbolic"; + label: _("About Notejot"); + }; + } +} \ No newline at end of file diff --git a/data/ui/main_window.ui b/data/ui/main_window.ui index f599320..102310a 100644 --- a/data/ui/main_window.ui +++ b/data/ui/main_window.ui @@ -2,16 +2,8 @@ - Text size - inline-buttons - zoom-grid + zoom -
- - About Notejot - win.action_about - -