LibGUI: Implement the virtual IconView::scroll_into_view()

This is virtual in AbstractView so let's not shadow it with an IconView
specific variant.
This commit is contained in:
Andreas Kling 2020-09-01 15:41:56 +02:00
parent 72443bd1ab
commit 27e86c03da
Notes: sideshowbarker 2024-07-19 02:57:02 +09:00
2 changed files with 6 additions and 3 deletions

View file

@ -62,9 +62,11 @@ void IconView::select_all()
}
}
void IconView::scroll_into_view(const ModelIndex& index, Orientation orientation)
void IconView::scroll_into_view(const ModelIndex& index, bool scroll_horizontally, bool scroll_vertically)
{
ScrollableWidget::scroll_into_view(item_rect(index.row()), orientation);
if (!index.is_valid())
return;
ScrollableWidget::scroll_into_view(item_rect(index.row()), scroll_horizontally, scroll_vertically);
}
void IconView::resize_event(ResizeEvent& event)

View file

@ -41,7 +41,8 @@ public:
int content_width() const;
int horizontal_padding() const { return m_horizontal_padding; }
void scroll_into_view(const ModelIndex&, Orientation);
virtual void scroll_into_view(const ModelIndex&, bool scroll_horizontally = true, bool scroll_vertically = true) override;
Gfx::IntSize effective_item_size() const { return m_effective_item_size; }
int model_column() const { return m_model_column; }