Browse Source

add navigation submenu

CPP-GTK4
yggverse 3 months ago
parent
commit
d321efd82e
  1. 62
      src/app/browser/header/menu.cpp
  2. 12
      src/app/browser/header/menu.hpp

62
src/app/browser/header/menu.cpp

@ -10,58 +10,84 @@ Menu::Menu() @@ -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(
// 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"
);
tab->append_submenu(
main_tab_page->append_submenu(
_("Navigation"),
main_tab_page_navigation
);
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() @@ -71,12 +97,12 @@ Menu::Menu()
main->append_submenu(
_("Tab"),
tab
main_tab
);
main->append_submenu(
_("Tools"),
tool
main_tools
);
main->append(

12
src/app/browser/header/menu.hpp

@ -9,11 +9,13 @@ namespace app::browser::header @@ -9,11 +9,13 @@ namespace app::browser::header
{
class Menu : public Gtk::MenuButton
{
Glib::RefPtr<Gio::Menu> tab,
tab_page,
tab_close,
tool,
main;
Glib::RefPtr<Gio::Menu> main,
main_tab,
main_tab_page,
main_tab_page_navigation,
main_tab_page_navigation_history,
main_tab_close,
main_tools;
public:

Loading…
Cancel
Save