83 lines
1.5 KiB
C++
Raw Normal View History

#include "menu.hpp"
using namespace app::browser::header;
Menu::Menu()
{
2024-08-12 18:12:01 +03:00
// Set widget defaults
set_tooltip_text(
2024-08-12 21:30:30 +03:00
_("Menu")
);
2024-08-12 18:12:01 +03:00
// Build tab submenu model
2024-08-12 09:45:22 +03:00
tab = Gio::Menu::create();
2024-08-12 18:12:01 +03:00
tab->append(
_("New tab.."),
2024-09-04 23:29:01 +03:00
"win.main_tab_append"
2024-08-12 18:12:01 +03:00
);
2024-08-13 20:05:21 +03:00
tab->append(
_("Update"),
2024-09-04 23:29:01 +03:00
"win.main_tab_update"
2024-08-13 20:05:21 +03:00
);
2024-08-12 18:27:25 +03:00
// Build tab close submenu model
tab_close = Gio::Menu::create();
2024-08-12 18:27:25 +03:00
tab_close->append(
_("Active tab"),
2024-09-04 23:29:01 +03:00
"win.main_tab_close"
2024-08-12 18:27:25 +03:00
);
tab_close->append(
2024-08-12 18:42:28 +03:00
_("All tabs to left"),
2024-09-04 23:29:01 +03:00
"win.main_tab_close_left"
2024-08-12 18:27:25 +03:00
);
tab_close->append(
2024-08-12 18:42:28 +03:00
_("All tabs to right"),
2024-09-04 23:29:01 +03:00
"win.main_tab_close_right"
2024-08-12 18:27:25 +03:00
);
tab_close->append(
_("All tabs"),
2024-09-04 23:29:01 +03:00
"win.main_tab_close_all"
2024-08-12 18:27:25 +03:00
);
tab->append_submenu(
_("Close"),
tab_close
2024-08-12 18:12:01 +03:00
);
// Build tool submenu model
2024-08-12 09:45:22 +03:00
tool = Gio::Menu::create();
2024-08-12 18:12:01 +03:00
tool->append(
_("Debug"),
"win.debug"
);
2024-08-12 18:12:01 +03:00
// Build main menu model
2024-08-12 09:45:22 +03:00
main = Gio::Menu::create();
2024-08-12 18:12:01 +03:00
main->append_submenu(
_("Tab"),
tab
);
2024-08-12 18:12:01 +03:00
main->append_submenu(
2024-08-12 18:42:28 +03:00
_("Tools"),
2024-08-12 18:12:01 +03:00
tool
);
2024-08-12 18:12:01 +03:00
main->append(
_("Quit"),
"app.quit"
);
2024-08-12 18:12:01 +03:00
// Apply model
set_menu_model(
main
);
2024-09-04 23:29:01 +03:00
}