mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-08 17:09:41 +00:00
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.
This commit is contained in:
parent
bb7d6fb310
commit
af02d0ee97
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue