summaryrefslogtreecommitdiff
path: root/DevTools/ProfileViewer
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-22 11:27:09 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-22 11:27:09 +0100
commitaf02d0ee97101e8d073b1906d4e000ad16db6166 (patch)
treefc681e1b255c62e74e3d5667b30b89638a2c6034 /DevTools/ProfileViewer
parentbb7d6fb310ba90bb5604d9e274f2e9e835e9abcf (diff)
downloadserenity-af02d0ee97101e8d073b1906d4e000ad16db6166.zip
ProfileViewer: Fix treeview selection looking unselected on Left key
When pressing the Left arrow key, we now travel to the parent_index() of the currently selected index. Our implementation of parent_index() was always returning an index with column 0, instead of using the same column as the current index. This prevented the selected item from looking selected.
Diffstat (limited to 'DevTools/ProfileViewer')
-rw-r--r--DevTools/ProfileViewer/ProfileModel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/DevTools/ProfileViewer/ProfileModel.cpp b/DevTools/ProfileViewer/ProfileModel.cpp
index 27fe98cb02..29a340d82f 100644
--- a/DevTools/ProfileViewer/ProfileModel.cpp
+++ b/DevTools/ProfileViewer/ProfileModel.cpp
@@ -64,7 +64,7 @@ GUI::ModelIndex ProfileModel::parent_index(const GUI::ModelIndex& index) const
if (!node.parent()->parent()) {
for (int row = 0; row < m_profile.roots().size(); ++row) {
if (m_profile.roots()[row].ptr() == node.parent()) {
- return create_index(row, 0, node.parent());
+ return create_index(row, index.column(), node.parent());
}
}
ASSERT_NOT_REACHED();
@@ -73,7 +73,7 @@ GUI::ModelIndex ProfileModel::parent_index(const GUI::ModelIndex& index) const
for (int row = 0; row < node.parent()->parent()->children().size(); ++row) {
if (node.parent()->parent()->children()[row].ptr() == node.parent())
- return create_index(row, 0, node.parent());
+ return create_index(row, index.column(), node.parent());
}
ASSERT_NOT_REACHED();