mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:57:35 +00: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)
|
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)
|
void AbstractTableView::context_menu_event(ContextMenuEvent& event)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue