summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser/InspectorWidget.cpp
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2021-05-25 22:48:43 +0200
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-05-26 17:39:13 +0430
commit2c772d184882dbdce0ec532f59c87743819f2e0d (patch)
treefd6bb1a769d1cd18140204b9d1c079ce18babf18 /Userland/Applications/Browser/InspectorWidget.cpp
parentebe38639bcd8aac5302f969747796d940c5ab20b (diff)
downloadserenity-2c772d184882dbdce0ec532f59c87743819f2e0d.zip
LibGUI/AbstractView: Remove `on_selection`
Since the introduction of multi-select, we have had both `on_selection` and `on_selection_change`, the latter of which was only invoked when a change in selection came in through the model. This removes `AbstractView::on_selection` and replaces it usage with the more explicit `on_selection_change` everywhere.
Diffstat (limited to 'Userland/Applications/Browser/InspectorWidget.cpp')
-rw-r--r--Userland/Applications/Browser/InspectorWidget.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Applications/Browser/InspectorWidget.cpp b/Userland/Applications/Browser/InspectorWidget.cpp
index a8053d8c4e..115f1ed281 100644
--- a/Userland/Applications/Browser/InspectorWidget.cpp
+++ b/Userland/Applications/Browser/InspectorWidget.cpp
@@ -41,13 +41,15 @@ InspectorWidget::InspectorWidget()
auto& top_tab_widget = splitter.add<GUI::TabWidget>();
m_dom_tree_view = top_tab_widget.add_tab<GUI::TreeView>("DOM");
- m_dom_tree_view->on_selection = [this](auto& index) {
+ m_dom_tree_view->on_selection_change = [this] {
+ const auto& index = m_dom_tree_view->selection().first();
auto* node = static_cast<Web::DOM::Node*>(index.internal_data());
set_inspected_node(node);
};
m_layout_tree_view = top_tab_widget.add_tab<GUI::TreeView>("Layout");
- m_layout_tree_view->on_selection = [this](auto& index) {
+ m_layout_tree_view->on_selection_change = [this] {
+ const auto& index = m_layout_tree_view->selection().first();
auto* node = static_cast<Web::Layout::Node*>(index.internal_data());
set_inspected_node(node->dom_node());
};