implement debug menu item

This commit is contained in:
yggverse 2024-08-11 09:55:10 +03:00
parent 8aab10c53e
commit cf64949986
5 changed files with 40 additions and 15 deletions

View file

@ -3,8 +3,9 @@
using namespace app;
Browser::Browser()
{
Browser::Browser(
const Glib::RefPtr<Gtk::Application> & app
) {
set_title(
TITLE
);
@ -17,4 +18,24 @@ Browser::Browser()
set_titlebar(
* new browser::Header()
);
}
add_action(
"debug",
sigc::mem_fun(
* this,
& Browser::debug
)
);
app->set_accel_for_action(
"win.debug",
"<Primary>i"
);
}
void Browser::debug()
{
gtk_window_set_interactive_debugging(
true
);
};

View file

@ -14,7 +14,11 @@ namespace app
const int WIDTH = 640;
const int HEIGHT = 480;
Browser();
Browser(
const Glib::RefPtr<Gtk::Application> & app
);
void debug();
};
}

View file

@ -14,7 +14,7 @@ Menu::Menu()
tab->append(
_("New tab"),
"app.tab.new"
"tab.new"
);
// Build tool submenu
@ -22,7 +22,7 @@ Menu::Menu()
tool->append(
_("Debug"),
"app.tool.debug"
"win.debug"
);
// Build main menu
@ -40,7 +40,7 @@ Menu::Menu()
main->append(
_("Quit"),
"win.quit"
"app.quit"
);
set_menu_model(