117 lines
2.8 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-09-05 03:40:52 +03:00
main_tab = Gio::Menu::create();
2024-09-05 03:40:52 +03:00
main_tab->append(
2024-08-12 18:12:01 +03:00
_("New tab.."),
2024-09-04 23:29:01 +03:00
"win.main_tab_append"
2024-08-12 18:12:01 +03:00
);
2024-09-05 03:11:10 +03:00
// Build tab page submenu model
2024-09-05 03:40:52 +03:00
main_tab_page = Gio::Menu::create();
2024-09-05 03:11:10 +03:00
2024-09-05 03:40:52 +03:00
// Build tab page navigation submenu model
main_tab_page_navigation = Gio::Menu::create();
// Build tab page navigation history submenu model
main_tab_page_navigation_history = Gio::Menu::create();
main_tab_page_navigation_history->append(
_("Back"),
"win.main_tab_page_navigation_history_try_back"
);
main_tab_page_navigation_history->append(
_("Forward"),
"win.main_tab_page_navigation_history_try_forward"
);
main_tab_page_navigation->append_submenu(
_("History"),
main_tab_page_navigation_history
);
main_tab_page_navigation->append(
_("Update"),
"win.main_tab_page_update"
);
main_tab_page->append_submenu(
_("Navigation"),
main_tab_page_navigation
2024-09-05 03:11:10 +03:00
);
2024-09-05 03:40:52 +03:00
main_tab->append_submenu(
2024-09-05 03:11:10 +03:00
_("Page"),
2024-09-05 03:40:52 +03:00
main_tab_page
2024-08-13 20:05:21 +03:00
);
2024-08-12 18:27:25 +03:00
// Build tab close submenu model
2024-09-05 03:40:52 +03:00
main_tab_close = Gio::Menu::create();
2024-09-05 03:40:52 +03:00
main_tab_close->append(
2024-08-12 18:27:25 +03:00
_("Active tab"),
2024-09-04 23:29:01 +03:00
"win.main_tab_close"
2024-08-12 18:27:25 +03:00
);
2024-09-05 03:40:52 +03:00
main_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
);
2024-09-05 03:40:52 +03:00
main_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
);
2024-09-05 03:40:52 +03:00
main_tab_close->append(
2024-08-12 18:27:25 +03:00
_("All tabs"),
2024-09-04 23:29:01 +03:00
"win.main_tab_close_all"
2024-08-12 18:27:25 +03:00
);
2024-09-05 03:40:52 +03:00
main_tab->append_submenu(
2024-08-12 18:27:25 +03:00
_("Close"),
2024-09-05 03:40:52 +03:00
main_tab_close
2024-08-12 18:12:01 +03:00
);
2024-09-05 03:40:52 +03:00
// Build tools submenu model
main_tools = Gio::Menu::create();
2024-09-05 03:40:52 +03:00
main_tools->append(
2024-08-12 18:12:01 +03:00
_("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"),
2024-09-05 03:40:52 +03:00
main_tab
2024-08-12 18:12:01 +03:00
);
2024-08-12 18:12:01 +03:00
main->append_submenu(
2024-08-12 18:42:28 +03:00
_("Tools"),
2024-09-05 03:40:52 +03:00
main_tools
2024-08-12 18:12:01 +03:00
);
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
}