mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
implement debug menu item
This commit is contained in:
parent
8aab10c53e
commit
cf64949986
@ -3,8 +3,9 @@
|
|||||||
|
|
||||||
using namespace app;
|
using namespace app;
|
||||||
|
|
||||||
Browser::Browser()
|
Browser::Browser(
|
||||||
{
|
const Glib::RefPtr<Gtk::Application> & app
|
||||||
|
) {
|
||||||
set_title(
|
set_title(
|
||||||
TITLE
|
TITLE
|
||||||
);
|
);
|
||||||
@ -17,4 +18,24 @@ Browser::Browser()
|
|||||||
set_titlebar(
|
set_titlebar(
|
||||||
* new browser::Header()
|
* 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
|
||||||
|
);
|
||||||
|
};
|
@ -14,7 +14,11 @@ namespace app
|
|||||||
const int WIDTH = 640;
|
const int WIDTH = 640;
|
||||||
const int HEIGHT = 480;
|
const int HEIGHT = 480;
|
||||||
|
|
||||||
Browser();
|
Browser(
|
||||||
|
const Glib::RefPtr<Gtk::Application> & app
|
||||||
|
);
|
||||||
|
|
||||||
|
void debug();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ Menu::Menu()
|
|||||||
|
|
||||||
tab->append(
|
tab->append(
|
||||||
_("New tab"),
|
_("New tab"),
|
||||||
"app.tab.new"
|
"tab.new"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Build tool submenu
|
// Build tool submenu
|
||||||
@ -22,7 +22,7 @@ Menu::Menu()
|
|||||||
|
|
||||||
tool->append(
|
tool->append(
|
||||||
_("Debug"),
|
_("Debug"),
|
||||||
"app.tool.debug"
|
"win.debug"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Build main menu
|
// Build main menu
|
||||||
@ -40,7 +40,7 @@ Menu::Menu()
|
|||||||
|
|
||||||
main->append(
|
main->append(
|
||||||
_("Quit"),
|
_("Quit"),
|
||||||
"win.quit"
|
"app.quit"
|
||||||
);
|
);
|
||||||
|
|
||||||
set_menu_model(
|
set_menu_model(
|
||||||
|
12
src/main.cpp
12
src/main.cpp
@ -3,22 +3,23 @@
|
|||||||
|
|
||||||
int main(
|
int main(
|
||||||
int argc,
|
int argc,
|
||||||
char* argv[]
|
char * argv[]
|
||||||
) {
|
) {
|
||||||
// Init app
|
// Init app
|
||||||
auto app = Gtk::Application::create(
|
auto app = Gtk::Application::create(
|
||||||
APPLICATION_ID
|
"io.github.yggverse.Yoda"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Init actions
|
// Init actions
|
||||||
app->add_action(
|
app->add_action(
|
||||||
"quit",
|
"quit",
|
||||||
sigc::mem_fun(
|
sigc::mem_fun(
|
||||||
*app,
|
* app,
|
||||||
&Gtk::Application::quit
|
& Gtk::Application::quit
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Init accels
|
||||||
app->set_accel_for_action(
|
app->set_accel_for_action(
|
||||||
"app.quit",
|
"app.quit",
|
||||||
"<Primary>q"
|
"<Primary>q"
|
||||||
@ -27,6 +28,7 @@ int main(
|
|||||||
// Launch browser component
|
// Launch browser component
|
||||||
return app->make_window_and_run<app::Browser>(
|
return app->make_window_and_run<app::Browser>(
|
||||||
argc,
|
argc,
|
||||||
argv
|
argv,
|
||||||
|
app
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -1,8 +1,6 @@
|
|||||||
#include <glibmm.h>
|
#include <glibmm.h>
|
||||||
|
|
||||||
const Glib::ustring APPLICATION_ID = "io.github.yggverse.Yoda";
|
|
||||||
|
|
||||||
int main(
|
int main(
|
||||||
int argc,
|
int argc,
|
||||||
char* argv[]
|
char * argv[]
|
||||||
);
|
);
|
Loading…
x
Reference in New Issue
Block a user