mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:07:46 +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:
parent
607bddac96
commit
3ef4ba810a
3 changed files with 7 additions and 0 deletions
|
@ -26,6 +26,7 @@ void InspectorWidget::set_inspected_node(GUI::ModelIndex const index)
|
|||
return;
|
||||
}
|
||||
auto* node = static_cast<Web::DOM::Node*>(index.internal_data());
|
||||
m_inspected_node = node;
|
||||
m_document->set_inspected_node(node);
|
||||
if (node && node->is_element()) {
|
||||
auto& element = verify_cast<Web::DOM::Element>(*node);
|
||||
|
@ -70,6 +71,7 @@ InspectorWidget::~InspectorWidget()
|
|||
|
||||
void InspectorWidget::set_document(Web::DOM::Document* document)
|
||||
{
|
||||
document->set_inspected_node(m_inspected_node);
|
||||
if (m_document == document)
|
||||
return;
|
||||
m_document = document;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue