mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 20:47:43 +00:00
Browser: Add a debug menu with actions to dump DOM and Layout trees
This commit is contained in:
parent
92b6a7a18f
commit
bf79b198f6
1 changed files with 9 additions and 0 deletions
|
@ -95,6 +95,15 @@ int main(int argc, char** argv)
|
||||||
}));
|
}));
|
||||||
menubar->add_menu(move(app_menu));
|
menubar->add_menu(move(app_menu));
|
||||||
|
|
||||||
|
auto debug_menu = make<GMenu>("Debug");
|
||||||
|
debug_menu->add_action(GAction::create("Dump DOM tree", [&](auto&) {
|
||||||
|
dump_tree(*html_widget->document());
|
||||||
|
}));
|
||||||
|
debug_menu->add_action(GAction::create("Dump Layout tree", [&](auto&) {
|
||||||
|
dump_tree(*html_widget->document()->layout_node());
|
||||||
|
}));
|
||||||
|
menubar->add_menu(move(debug_menu));
|
||||||
|
|
||||||
auto help_menu = make<GMenu>("Help");
|
auto help_menu = make<GMenu>("Help");
|
||||||
help_menu->add_action(GAction::create("About", [&](const GAction&) {
|
help_menu->add_action(GAction::create("About", [&](const GAction&) {
|
||||||
GAboutDialog::show("Browser", GraphicsBitmap::load_from_file("/res/icons/32x32/filetype-html.png"), window);
|
GAboutDialog::show("Browser", GraphicsBitmap::load_from_file("/res/icons/32x32/filetype-html.png"), window);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue