1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 12:27:35 +00:00

Browser: Hide inspected-element outline when DOM Inspector is closed

...and then show it again when the inspector is re-opened. :^)
This commit is contained in:
Sam Atkins 2021-08-17 14:16:09 +01:00 committed by Andreas Kling
parent 607bddac96
commit 3ef4ba810a
3 changed files with 7 additions and 0 deletions

View file

@ -220,6 +220,9 @@ void BrowserWindow::build_menus()
tab.m_dom_inspector_window->set_title("DOM inspector");
tab.m_dom_inspector_window->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object.png"));
tab.m_dom_inspector_window->set_main_widget<InspectorWidget>();
tab.m_dom_inspector_window->on_close = [&]() {
tab.m_page_view->document()->set_inspected_node(nullptr);
};
}
auto* inspector_widget = static_cast<InspectorWidget*>(tab.m_dom_inspector_window->main_widget());
inspector_widget->set_document(tab.m_page_view->document());