summaryrefslogtreecommitdiffstats
path: root/gui/groupview/GroupView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/groupview/GroupView.cpp')
-rw-r--r--gui/groupview/GroupView.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/gui/groupview/GroupView.cpp b/gui/groupview/GroupView.cpp
index 9954d743..5ee44cbb 100644
--- a/gui/groupview/GroupView.cpp
+++ b/gui/groupview/GroupView.cpp
@@ -121,6 +121,8 @@ void GroupView::updateGeometries()
category->m_verticalPosition = totalHeight;
totalHeight += category->totalHeight() + m_categoryMargin;
}
+ auto category = m_groups.last();
+ int itemScroll = category->contentHeight() / category->numRows();
/*
// remove the last margin (we don't want it)
totalHeight -= m_categoryMargin;
@@ -128,6 +130,10 @@ void GroupView::updateGeometries()
totalHeight += m_categoryMargin;
*/
totalHeight += m_bottomMargin;
+ verticalScrollBar()->setSingleStep ( itemScroll );
+ const int rowsPerPage = qMax ( viewport()->height() / itemScroll, 1 );
+ verticalScrollBar()->setPageStep ( rowsPerPage * itemScroll );
+
verticalScrollBar()->setRange(0, totalHeight - height());
}