diff options
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r-- | Libraries/LibGUI/AbstractTableView.cpp | 6 | ||||
-rw-r--r-- | Libraries/LibGUI/AbstractTableView.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Libraries/LibGUI/AbstractTableView.cpp b/Libraries/LibGUI/AbstractTableView.cpp index ff25d77f89..a06d6aa0fc 100644 --- a/Libraries/LibGUI/AbstractTableView.cpp +++ b/Libraries/LibGUI/AbstractTableView.cpp @@ -460,6 +460,12 @@ void AbstractTableView::scroll_into_view(const ModelIndex& index, Orientation or ScrollableWidget::scroll_into_view(rect, orientation); } +void AbstractTableView::scroll_into_view(const ModelIndex& index, bool scroll_horizontally, bool scroll_vertically) +{ + auto rect = row_rect(index.row()).translated(0, -header_height()); + ScrollableWidget::scroll_into_view(rect, scroll_horizontally, scroll_vertically); +} + void AbstractTableView::doubleclick_event(MouseEvent& event) { if (!model()) diff --git a/Libraries/LibGUI/AbstractTableView.h b/Libraries/LibGUI/AbstractTableView.h index e7bfdaac96..c405c64016 100644 --- a/Libraries/LibGUI/AbstractTableView.h +++ b/Libraries/LibGUI/AbstractTableView.h @@ -71,6 +71,7 @@ public: Gfx::IntRect row_rect(int item_index) const; void scroll_into_view(const ModelIndex&, Orientation); + void scroll_into_view(const ModelIndex&, bool scroll_horizontally, bool scroll_vertically); virtual ModelIndex index_at_event_position(const Gfx::IntPoint&, bool& is_toggle) const; virtual ModelIndex index_at_event_position(const Gfx::IntPoint&) const override; |