From e12e8c2b7b4795e1c8d0e6855df494bcc2cbb1ee Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 12 Aug 2024 18:27:25 +0300 Subject: [PATCH] implement tab close options as submenu --- src/app/browser/header/menu.cpp | 32 +++++++++++++++++++++++++------- src/app/browser/header/menu.hpp | 1 + 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/app/browser/header/menu.cpp b/src/app/browser/header/menu.cpp index 8e2c6cae..98186bdb 100644 --- a/src/app/browser/header/menu.cpp +++ b/src/app/browser/header/menu.cpp @@ -17,14 +17,32 @@ Menu::Menu() "win.tab_append" ); - tab->append( - _("Close active"), - "win.tab_close" - ); + // Build tab close submenu model + tab_close = Gio::Menu::create(); - tab->append( - _("Close all"), - "win.tab_close_all" + tab_close->append( + _("Active tab"), + "win.tab_close" + ); + + tab_close->append( + _("Tabs to left"), + "win.tab_close_left" + ); + + tab_close->append( + _("Tabs to right"), + "win.tab_close_right" + ); + + tab_close->append( + _("All tabs"), + "win.tab_close_all" + ); + + tab->append_submenu( + _("Close"), + tab_close ); // Build tool submenu model diff --git a/src/app/browser/header/menu.hpp b/src/app/browser/header/menu.hpp index ac3774ac..7a2778d7 100644 --- a/src/app/browser/header/menu.hpp +++ b/src/app/browser/header/menu.hpp @@ -12,6 +12,7 @@ namespace app::browser::header private: Glib::RefPtr tab, + tab_close, tool, main;