mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:08:11 +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
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue