HackStudio: Scroll the locator suggestions when navigating with arrows

This commit is contained in:
Andreas Kling 2019-10-28 18:51:06 +01:00
parent b4de5ac128
commit 29ac3e1477
Notes: sideshowbarker 2024-07-19 11:30:44 +09:00

View File

@ -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();