mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
LibGUI: Scroll selected treeview entries into view
This commit is contained in:
committed by
Andreas Kling
parent
cb9d9846e0
commit
0086daf9b0
@@ -386,6 +386,7 @@ void TreeView::keydown_event(KeyEvent& event)
|
||||
});
|
||||
if (found_index.is_valid()) {
|
||||
selection().set(found_index);
|
||||
scroll_into_view(selection().first(), Orientation::Vertical);
|
||||
update();
|
||||
}
|
||||
return;
|
||||
@@ -401,8 +402,11 @@ void TreeView::keydown_event(KeyEvent& event)
|
||||
previous_index = index;
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
if (found_index.is_valid())
|
||||
if (found_index.is_valid()) {
|
||||
selection().set(found_index);
|
||||
scroll_into_view(selection().first(), Orientation::Vertical);
|
||||
update();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -423,6 +427,7 @@ void TreeView::keydown_event(KeyEvent& event)
|
||||
}
|
||||
if (cursor_index.is_valid() && cursor_index.parent().is_valid()) {
|
||||
selection().set(cursor_index.parent());
|
||||
scroll_into_view(selection().first(), Orientation::Vertical);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -436,6 +441,7 @@ void TreeView::keydown_event(KeyEvent& event)
|
||||
}
|
||||
|
||||
selection().set(model()->index(0, model()->tree_column(), cursor_index));
|
||||
scroll_into_view(selection().first(), Orientation::Vertical);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user