mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-06 16:09:30 +00:00
HackStudio: Scroll the locator suggestions when navigating with arrows
This commit is contained in:
parent
b4de5ac128
commit
29ac3e1477
|
@ -89,8 +89,10 @@ Locator::Locator(GWidget* parent)
|
|||
else
|
||||
new_index = m_suggestion_view->model()->index(0);
|
||||
|
||||
if (new_index.is_valid())
|
||||
if (new_index.is_valid()) {
|
||||
m_suggestion_view->selection().set(new_index);
|
||||
m_suggestion_view->scroll_into_view(new_index, Orientation::Vertical);
|
||||
}
|
||||
};
|
||||
m_textbox->on_down = [this] {
|
||||
GModelIndex new_index = m_suggestion_view->selection().first();
|
||||
|
@ -99,8 +101,10 @@ Locator::Locator(GWidget* parent)
|
|||
else
|
||||
new_index = m_suggestion_view->model()->index(0);
|
||||
|
||||
if (new_index.is_valid())
|
||||
if (new_index.is_valid()) {
|
||||
m_suggestion_view->selection().set(new_index);
|
||||
m_suggestion_view->scroll_into_view(new_index, Orientation::Vertical);
|
||||
}
|
||||
};
|
||||
m_textbox->on_return_pressed = [this] {
|
||||
auto selected_index = m_suggestion_view->selection().first();
|
||||
|
|
Loading…
Reference in a new issue