2024-08-10 17:57:15 +03:00
|
|
|
#include "menu.hpp"
|
|
|
|
|
|
|
|
using namespace app::browser::header;
|
|
|
|
|
|
|
|
Menu::Menu()
|
|
|
|
{
|
2024-08-12 18:12:01 +03:00
|
|
|
// Set widget defaults
|
2024-08-10 17:57:15 +03:00
|
|
|
set_tooltip_text(
|
2024-08-12 21:30:30 +03:00
|
|
|
_("Menu")
|
2024-08-10 17:57:15 +03:00
|
|
|
);
|
|
|
|
|
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-10 17:57:15 +03:00
|
|
|
|
2024-08-12 18:12:01 +03:00
|
|
|
tab->append(
|
|
|
|
_("New tab.."),
|
|
|
|
"win.tab_append"
|
|
|
|
);
|
|
|
|
|
2024-08-12 18:27:25 +03:00
|
|
|
// Build tab close submenu model
|
|
|
|
tab_close = Gio::Menu::create();
|
2024-08-10 17:57:15 +03:00
|
|
|
|
2024-08-12 18:27:25 +03:00
|
|
|
tab_close->append(
|
|
|
|
_("Active tab"),
|
|
|
|
"win.tab_close"
|
|
|
|
);
|
|
|
|
|
|
|
|
tab_close->append(
|
2024-08-12 18:42:28 +03:00
|
|
|
_("All tabs to left"),
|
2024-08-12 18:27:25 +03:00
|
|
|
"win.tab_close_left"
|
|
|
|
);
|
|
|
|
|
|
|
|
tab_close->append(
|
2024-08-12 18:42:28 +03:00
|
|
|
_("All tabs to right"),
|
2024-08-12 18:27:25 +03:00
|
|
|
"win.tab_close_right"
|
|
|
|
);
|
|
|
|
|
|
|
|
tab_close->append(
|
|
|
|
_("All tabs"),
|
|
|
|
"win.tab_close_all"
|
|
|
|
);
|
|
|
|
|
|
|
|
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-10 17:57:15 +03:00
|
|
|
|
2024-08-12 18:12:01 +03:00
|
|
|
tool->append(
|
|
|
|
_("Debug"),
|
|
|
|
"win.debug"
|
|
|
|
);
|
2024-08-10 17:57:15 +03:00
|
|
|
|
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-10 17:57:15 +03:00
|
|
|
|
2024-08-12 18:12:01 +03:00
|
|
|
main->append_submenu(
|
|
|
|
_("Tab"),
|
|
|
|
tab
|
|
|
|
);
|
2024-08-10 17:57:15 +03:00
|
|
|
|
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-10 17:57:15 +03:00
|
|
|
|
2024-08-12 18:12:01 +03:00
|
|
|
main->append(
|
|
|
|
_("Quit"),
|
|
|
|
"app.quit"
|
|
|
|
);
|
2024-08-10 17:57:15 +03:00
|
|
|
|
2024-08-12 18:12:01 +03:00
|
|
|
// Apply model
|
2024-08-10 17:57:15 +03:00
|
|
|
set_menu_model(
|
|
|
|
main
|
|
|
|
);
|
2024-08-12 09:45:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Menu::~Menu() = default;
|