LibGUI: Make AbstractView::set_cursor() scrolling into view optional

Sometimes you just want to set the cursor programmatically without
scrolling the view to make the cursor visible.
This commit is contained in:
Andreas Kling 2020-08-29 00:17:42 +02:00
commit fed53e19c7
Notes: sideshowbarker 2024-07-19 03:03:20 +09:00
2 changed files with 7 additions and 4 deletions

View file

@ -114,7 +114,7 @@ public:
virtual void scroll_into_view(const ModelIndex&, [[maybe_unused]] bool scroll_horizontally = true, [[maybe_unused]] bool scroll_vertically = true) { }
const ModelIndex& cursor_index() const { return m_cursor_index; }
void set_cursor(ModelIndex, SelectionUpdate);
void set_cursor(ModelIndex, SelectionUpdate, bool scroll_cursor_into_view = true);
bool is_tab_key_navigation_enabled() const { return m_tab_key_navigation_enabled; }
void set_tab_key_navigation_enabled(bool enabled) { m_tab_key_navigation_enabled = enabled; }