Skip to content

Commit

Permalink
HackStudio: Scroll the locator suggestions when navigating with arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Oct 28, 2019
1 parent b4de5ac commit 29ac3e1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions DevTools/HackStudio/Locator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 29ac3e1

Please sign in to comment.