summaryrefslogtreecommitdiffstats
path: root/gui/groupview/GroupView.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-02-09 20:45:18 +0100
committerPetr Mrázek <peterix@gmail.com>2014-02-09 20:45:18 +0100
commit18f532b0d7d873280ec17218196db15fa64175a2 (patch)
tree8bd80c7c1db58e7c5eb353169440e65208f71830 /gui/groupview/GroupView.cpp
parent0d30a2655ffb767488d50a4a79978b3d9ddb3aa9 (diff)
downloadMultiMC-18f532b0d7d873280ec17218196db15fa64175a2.tar
MultiMC-18f532b0d7d873280ec17218196db15fa64175a2.tar.gz
MultiMC-18f532b0d7d873280ec17218196db15fa64175a2.tar.lz
MultiMC-18f532b0d7d873280ec17218196db15fa64175a2.tar.xz
MultiMC-18f532b0d7d873280ec17218196db15fa64175a2.zip
Visual and scroll behavior changes to groupview
Scroll by rows, not pixels. Paint the checkboxy thing again! Make0 it behave. Set the group header height properly.
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());
}