Browse Source

create tab page submenu

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

2
src/app/browser.cpp

@ -42,7 +42,7 @@ Browser::Browser( @@ -42,7 +42,7 @@ Browser::Browser(
);
add_action(
"main_tab_update",
"main_tab_page_update",
[this]
{
browserMain->tab_update();

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

@ -17,9 +17,17 @@ Menu::Menu() @@ -17,9 +17,17 @@ Menu::Menu()
"win.main_tab_append"
);
tab->append(
// Build tab page submenu model
tab_page = Gio::Menu::create();
tab_page->append(
_("Update"),
"win.main_tab_update"
"win.main_tab_page_update"
);
tab->append_submenu(
_("Page"),
tab_page
);
// Build tab close submenu model

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

@ -10,6 +10,7 @@ namespace app::browser::header @@ -10,6 +10,7 @@ namespace app::browser::header
class Menu : public Gtk::MenuButton
{
Glib::RefPtr<Gio::Menu> tab,
tab_page,
tab_close,
tool,
main;

2
src/main.cpp

@ -33,7 +33,7 @@ int main( @@ -33,7 +33,7 @@ int main(
);
app->set_accel_for_action(
"win.main_tab_update",
"win.main_tab_page_update",
"<Primary>r"
);

Loading…
Cancel
Save