mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-25 19:02:07 -05:00
LibGUI: Table views with SelectRows should scroll entire rows into view
This commit is contained in:
parent
f0138fcb25
commit
598efa60a3
1 changed files with 10 additions and 1 deletions
|
@ -240,7 +240,16 @@ void AbstractTableView::move_cursor_relative(int vertical_steps, int horizontal_
|
|||
|
||||
void AbstractTableView::scroll_into_view(const ModelIndex& index, bool scroll_horizontally, bool scroll_vertically)
|
||||
{
|
||||
ScrollableWidget::scroll_into_view(content_rect(index), scroll_horizontally, scroll_vertically);
|
||||
Gfx::IntRect rect;
|
||||
switch (selection_behavior()) {
|
||||
case SelectionBehavior::SelectItems:
|
||||
rect = content_rect(index);
|
||||
break;
|
||||
case SelectionBehavior::SelectRows:
|
||||
rect = row_rect(index.row());
|
||||
break;
|
||||
}
|
||||
ScrollableWidget::scroll_into_view(rect, scroll_horizontally, scroll_vertically);
|
||||
}
|
||||
|
||||
void AbstractTableView::context_menu_event(ContextMenuEvent& event)
|
||||
|
|
Loading…
Add table
Reference in a new issue