Browse Source

make arguments const

CPP-GTK4
yggverse 3 months ago
parent
commit
2897699464
  1. 24
      src/app/browser/header/menu.cpp
  2. 12
      src/app/browser/header/menu.hpp

24
src/app/browser/header/menu.cpp

@ -24,19 +24,19 @@ Menu::Menu()
} }
Glib::RefPtr<Gio::Menu> Menu::main( Glib::RefPtr<Gio::Menu> Menu::main(
Glib::RefPtr<Gio::Menu> main_tab, const Glib::RefPtr<Gio::Menu> MAIN_TAB,
Glib::RefPtr<Gio::Menu> main_tools const Glib::RefPtr<Gio::Menu> MAIN_TOOLS
) { ) {
auto menu = Gio::Menu::create(); auto menu = Gio::Menu::create();
menu->append_submenu( menu->append_submenu(
_("Tab"), _("Tab"),
main_tab MAIN_TAB
); );
menu->append_submenu( menu->append_submenu(
_("Tools"), _("Tools"),
main_tools MAIN_TOOLS
); );
menu->append( menu->append(
@ -48,8 +48,8 @@ Glib::RefPtr<Gio::Menu> Menu::main(
} }
Glib::RefPtr<Gio::Menu> Menu::main_tab( Glib::RefPtr<Gio::Menu> Menu::main_tab(
Glib::RefPtr<Gio::Menu> main_tab_page, const Glib::RefPtr<Gio::Menu> MAIN_TAB_PAGE,
Glib::RefPtr<Gio::Menu> main_tab_close const Glib::RefPtr<Gio::Menu> MAIN_TAB_CLOSE
) { ) {
auto menu = Gio::Menu::create(); auto menu = Gio::Menu::create();
@ -60,38 +60,38 @@ Glib::RefPtr<Gio::Menu> Menu::main_tab(
menu->append_submenu( menu->append_submenu(
_("Page"), _("Page"),
main_tab_page MAIN_TAB_PAGE
); );
menu->append_submenu( menu->append_submenu(
_("Close"), _("Close"),
main_tab_close MAIN_TAB_CLOSE
); );
return menu; return menu;
} }
Glib::RefPtr<Gio::Menu> Menu::main_tab_page( Glib::RefPtr<Gio::Menu> Menu::main_tab_page(
Glib::RefPtr<Gio::Menu> main_tab_page_navigation const Glib::RefPtr<Gio::Menu> MAIN_TAB_PAGE_NAVIGATION
) { ) {
auto menu = Gio::Menu::create(); auto menu = Gio::Menu::create();
menu->append_submenu( menu->append_submenu(
_("Navigation"), _("Navigation"),
main_tab_page_navigation MAIN_TAB_PAGE_NAVIGATION
); );
return menu; return menu;
} }
Glib::RefPtr<Gio::Menu> Menu::main_tab_page_navigation( Glib::RefPtr<Gio::Menu> Menu::main_tab_page_navigation(
Glib::RefPtr<Gio::Menu> main_tab_page_navigation_history const Glib::RefPtr<Gio::Menu> MAIN_TAB_PAGE_NAVIGATION_HISTORY
) { ) {
auto menu = Gio::Menu::create(); auto menu = Gio::Menu::create();
menu->append_submenu( menu->append_submenu(
_("History"), _("History"),
main_tab_page_navigation_history MAIN_TAB_PAGE_NAVIGATION_HISTORY
); );
menu->append( menu->append(

12
src/app/browser/header/menu.hpp

@ -11,24 +11,24 @@ namespace app::browser::header
{ {
// 1 level // 1 level
static Glib::RefPtr<Gio::Menu> main( static Glib::RefPtr<Gio::Menu> main(
Glib::RefPtr<Gio::Menu> main_tab, const Glib::RefPtr<Gio::Menu> MAIN_TAB,
Glib::RefPtr<Gio::Menu> main_tools const Glib::RefPtr<Gio::Menu> MAIN_TOOLS
); );
// 2 level // 2 level
static Glib::RefPtr<Gio::Menu> main_tab( static Glib::RefPtr<Gio::Menu> main_tab(
Glib::RefPtr<Gio::Menu> main_tab_page, const Glib::RefPtr<Gio::Menu> MAIN_TAB_PAGE,
Glib::RefPtr<Gio::Menu> main_tab_close const Glib::RefPtr<Gio::Menu> MAIN_TAB_CLOSE
); );
// 3 level // 3 level
static Glib::RefPtr<Gio::Menu> main_tab_page( static Glib::RefPtr<Gio::Menu> main_tab_page(
Glib::RefPtr<Gio::Menu> main_tab_page_navigation const Glib::RefPtr<Gio::Menu> MAIN_TAB_PAGE_NAVIGATION
); );
// 4 level // 4 level
static Glib::RefPtr<Gio::Menu> main_tab_page_navigation( static Glib::RefPtr<Gio::Menu> main_tab_page_navigation(
Glib::RefPtr<Gio::Menu> main_tab_page_navigation_history const Glib::RefPtr<Gio::Menu> MAIN_TAB_PAGE_NAVIGATION_HISTORY
); );
// 5 level // 5 level

Loading…
Cancel
Save