Browse Source

create tab page submenu

CPP-GTK4
yggverse 3 months ago
parent
commit
c0b7e9e969
  1. 2
      src/app/browser.cpp
  2. 14
      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(
); );
add_action( add_action(
"main_tab_update", "main_tab_page_update",
[this] [this]
{ {
browserMain->tab_update(); browserMain->tab_update();

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

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

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

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

2
src/main.cpp

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

Loading…
Cancel
Save