From 7b0e86e13cfdb249d0d712036f7aa4497af40ca8 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 12:17:28 +0200 Subject: [PATCH] rework ui --- src/ui/window.blp | 163 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 115 insertions(+), 48 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index d29835c9..9048ead6 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -1,62 +1,116 @@ using Gtk 4.0; using Adw 1; -template AdwcustomizerMainWindow : ApplicationWindow { +template AdwcustomizerMainWindow : Adw.ApplicationWindow { title: _("Adwaita Manager"); default-width: 1280; default-height: 720; - titlebar: HeaderBar { - [start] - Button apply-button { - styles ["suggested-action"] - label: _("Apply"); - action-name: "app.apply_color_scheme"; - } + Adw.Leaflet leaflet { + can-navigate-back: true; + can-unfold: false; - [start] - Button save-preset-button { - action-name: "app.save_preset"; - tooltip-text: _("Save Preset"); - Adw.ButtonContent { - icon-name: "document-save-symbolic"; - } - } + Gtk.Box main_view { + orientation: vertical; - // [start] - // MenuButton presets-dropdown { - // icon-name: "palette-symbolic"; - // menu-model: presets-menu; - // tooltip-text: _("Presets"); - // } + Adw.HeaderBar titlebar { + centering-policy: strict; - [title] - Adw.ViewSwitcherTitle view-switcher { - stack: stack - } + [start] + Button apply-button { + styles ["suggested-action"] + label: _("Apply"); + action-name: "app.apply_color_scheme"; + } - [end] - MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } + [start] + Button save-preset-button { + action-name: "app.save_preset"; + tooltip-text: _("Save Preset"); + Adw.ButtonContent { + icon-name: "document-save-symbolic"; + } + } - [end] - MenuButton errors-button { - styles ["raised", "error"] - icon-name: "dialog-warning-symbolic"; - popover: errors-popover; - } - }; + [title] + Adw.ViewSwitcherTitle title { + stack: view_stack; + } - Box { - Adw.ViewStack stack { - MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } - } - Adw.PreferencesPage content { } + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + + [end] + MenuButton presets-dropdown { + menu-model: presets-menu; + label: _("Presets"); + icon-name: "palette-symbolic.svg"; + } + + [end] + MenuButton errors-button { + styles ["raised", "error"] + icon-name: "dialog-warning-symbolic"; + popover: errors-popover; + } + + } + + Gtk.Box { + orientation: vertical; + + Adw.ViewStack view_stack { + vexpand: true; + hexpand: true; + + Adw.ViewStackPage { + name: "colors"; + title: C_("Navigation", "Colors"); + icon-name: "puzzle-piece-symbolic"; + + child: Gtk.Label { + label: _("WIP"); + }; + + } + + Adw.ViewStackPage { + name: "monet"; + title: C_("Navigation", "Monet"); + icon-name: "globe-symbolic"; + + + child: Gtk.Label { + label: _("WIP"); + }; + + } + + Adw.ViewStackPage { + name: "css"; + title: C_("Navigation", "CSS"); + icon-name: "globe-symbolic"; + + + child: Gtk.Label { + label: _("WIP"); + }; + + //child: .ExmBrowsePage browse_page {}; + } + } + + Adw.ViewSwitcherBar { + stack: view_stack; + reveal: bind title.title-visible; + } + } + } + + Adw.PreferencesPage content { } } } @@ -76,9 +130,22 @@ menu presets-menu { } } + menu main-menu { - item (_("Reset Applied Color Scheme"), "app.reset_color_scheme") - item (_("About Adwaita Manager"), "app.about") + section { + item { + label: _("Release Notes"); + action: "win.show-release-notes"; + } + item { + label: _("Reset Applied Color Scheme"); + action: "app.reset_color_scheme"; + } + item { + label: _("About Adwaita Manager"); + action: "app.about"; + } + } } Popover errors-popover {