From d321efd82ec4084fbbf73e71c91f0ac352ae5e8b Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 5 Sep 2024 03:40:52 +0300 Subject: [PATCH] add navigation submenu --- src/app/browser/header/menu.cpp | 66 +++++++++++++++++++++++---------- src/app/browser/header/menu.hpp | 12 +++--- 2 files changed, 53 insertions(+), 25 deletions(-) diff --git a/src/app/browser/header/menu.cpp b/src/app/browser/header/menu.cpp index 73616cb8..27493e2e 100644 --- a/src/app/browser/header/menu.cpp +++ b/src/app/browser/header/menu.cpp @@ -10,58 +10,84 @@ Menu::Menu() ); // Build tab submenu model - tab = Gio::Menu::create(); + main_tab = Gio::Menu::create(); - tab->append( + main_tab->append( _("New tab.."), "win.main_tab_append" ); // Build tab page submenu model - tab_page = Gio::Menu::create(); + main_tab_page = Gio::Menu::create(); - tab_page->append( - _("Update"), - "win.main_tab_page_update" + // Build tab page navigation submenu model + main_tab_page_navigation = Gio::Menu::create(); + + // Build tab page navigation history submenu model + main_tab_page_navigation_history = Gio::Menu::create(); + + main_tab_page_navigation_history->append( + _("Back"), + "win.main_tab_page_navigation_history_try_back" + ); + + main_tab_page_navigation_history->append( + _("Forward"), + "win.main_tab_page_navigation_history_try_forward" + ); + + main_tab_page_navigation->append_submenu( + _("History"), + main_tab_page_navigation_history + ); + + main_tab_page_navigation->append( + _("Update"), + "win.main_tab_page_update" + ); + + main_tab_page->append_submenu( + _("Navigation"), + main_tab_page_navigation ); - tab->append_submenu( + main_tab->append_submenu( _("Page"), - tab_page + main_tab_page ); // Build tab close submenu model - tab_close = Gio::Menu::create(); + main_tab_close = Gio::Menu::create(); - tab_close->append( + main_tab_close->append( _("Active tab"), "win.main_tab_close" ); - tab_close->append( + main_tab_close->append( _("All tabs to left"), "win.main_tab_close_left" ); - tab_close->append( + main_tab_close->append( _("All tabs to right"), "win.main_tab_close_right" ); - tab_close->append( + main_tab_close->append( _("All tabs"), "win.main_tab_close_all" ); - tab->append_submenu( + main_tab->append_submenu( _("Close"), - tab_close + main_tab_close ); - // Build tool submenu model - tool = Gio::Menu::create(); + // Build tools submenu model + main_tools = Gio::Menu::create(); - tool->append( + main_tools->append( _("Debug"), "win.debug" ); @@ -71,12 +97,12 @@ Menu::Menu() main->append_submenu( _("Tab"), - tab + main_tab ); main->append_submenu( _("Tools"), - tool + main_tools ); main->append( diff --git a/src/app/browser/header/menu.hpp b/src/app/browser/header/menu.hpp index f54a78b4..d3d3c118 100644 --- a/src/app/browser/header/menu.hpp +++ b/src/app/browser/header/menu.hpp @@ -9,11 +9,13 @@ namespace app::browser::header { class Menu : public Gtk::MenuButton { - Glib::RefPtr tab, - tab_page, - tab_close, - tool, - main; + Glib::RefPtr main, + main_tab, + main_tab_page, + main_tab_page_navigation, + main_tab_page_navigation_history, + main_tab_close, + main_tools; public: