draft new tab menu actions

This commit is contained in:
yggverse 2024-08-12 18:12:01 +03:00
parent ea64d486a2
commit c7a67e4afd
4 changed files with 38 additions and 27 deletions

View File

@ -34,7 +34,7 @@ Browser::Browser(
// Init actions // Init actions
add_action( add_action(
"tab", "tab_append",
sigc::mem_fun( sigc::mem_fun(
* this, * this,
& Browser::mainTabAppend & Browser::mainTabAppend

View File

@ -4,45 +4,56 @@ using namespace app::browser::header;
Menu::Menu() Menu::Menu()
{ {
// Init defaults // Set widget defaults
set_tooltip_text( set_tooltip_text(
TOOLTIP TOOLTIP
); );
// Build tab submenu // Build tab submenu model
tab = Gio::Menu::create(); tab = Gio::Menu::create();
tab->append( tab->append(
_("New tab.."), _("New tab.."),
"win.tab" "win.tab_append"
); );
// Build tool submenu tab->append(
_("Close active"),
"win.tab_close"
);
tab->append(
_("Close all"),
"win.tab_close_all"
);
// Build tool submenu model
tool = Gio::Menu::create(); tool = Gio::Menu::create();
tool->append( tool->append(
_("Debug"), _("Debug"),
"win.debug" "win.debug"
); );
// Build main menu // Build main menu model
main = Gio::Menu::create(); main = Gio::Menu::create();
main->append_submenu( main->append_submenu(
_("Tab"), _("Tab"),
tab tab
); );
main->append_submenu( main->append_submenu(
_("Tool"), _("Tool"),
tool tool
); );
main->append( main->append(
_("Quit"), _("Quit"),
"app.quit" "app.quit"
); );
// Apply model
set_menu_model( set_menu_model(
main main
); );

View File

@ -10,7 +10,7 @@ namespace app::browser::header
{ {
public: public:
const char* ACTION = "win.tab"; const char* ACTION = "win.tab_append";
const char* ICON = "tab-new-symbolic"; const char* ICON = "tab-new-symbolic";
const char* TOOLTIP = _("New tab"); const char* TOOLTIP = _("New tab");

View File

@ -28,7 +28,7 @@ int main(
// Init accels @TODO db settings // Init accels @TODO db settings
app->set_accel_for_action( app->set_accel_for_action(
"win.tab", "win.tab_append",
"<Primary>t" "<Primary>t"
); );