mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +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
Notes:
sideshowbarker
2024-07-18 05:20:59 +09:00
Author: https://github.com/AtkinsSJ
Commit: 3ef4ba810a
Pull-request: https://github.com/SerenityOS/serenity/pull/9474
Issue: https://github.com/SerenityOS/serenity/issues/8936
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