mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 03:45:08 +00:00
LibGUI: GTableView scrolling ranges should be based on the available area.
We have to subtract the headers and scrollbars to get the correct behavior.
This commit is contained in:
parent
6c2089c59d
commit
9c21874d33
1 changed files with 4 additions and 2 deletions
|
@ -47,10 +47,12 @@ void GTableView::resize_event(GResizeEvent& event)
|
|||
|
||||
void GTableView::update_scrollbar_ranges()
|
||||
{
|
||||
int excess_height = max(0, (item_count() * item_height()) - height());
|
||||
int available_height = height() - header_height() - m_horizontal_scrollbar->height();
|
||||
int excess_height = max(0, (item_count() * item_height()) - available_height);
|
||||
m_vertical_scrollbar->set_range(0, excess_height);
|
||||
|
||||
int excess_width = max(0, content_width() - width());
|
||||
int available_width = width() - m_vertical_scrollbar->width();
|
||||
int excess_width = max(0, content_width() - available_width);
|
||||
m_horizontal_scrollbar->set_range(0, excess_width);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue