diff options
| author | Peter Penz <[email protected]> | 2011-12-05 19:56:41 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-12-05 20:01:11 +0100 |
| commit | 51e18583988b6404715dd9dc57863b597d7e381d (patch) | |
| tree | 0c9ccab5aca41e44e136eaf3bc3b678d23c06317 /src | |
| parent | eb21254eef1f314fdd3f57896c65a826f749c4ad (diff) | |
Fix calculation of maximum scroll offset
The maximum scroll offset must be the maximum y-range of the last
row, not only the maximum of the last item.
Thanks to Frank Reininghaus for analysing the root-cause and
for providing the initial patch!
BUG: 287211
FIXED-IN: 4.8.0
Diffstat (limited to 'src')
| -rw-r--r-- | src/kitemviews/kitemlistviewlayouter.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistviewlayouter.cpp b/src/kitemviews/kitemlistviewlayouter.cpp index 728a67aa5..cc7333232 100644 --- a/src/kitemviews/kitemlistviewlayouter.cpp +++ b/src/kitemviews/kitemlistviewlayouter.cpp @@ -399,7 +399,16 @@ void KItemListViewLayouter::doLayout() } if (itemCount > 0) { + // Calculate the maximum y-range of the last row for m_maximumScrollOffset m_maximumScrollOffset = m_itemRects.last().bottom(); + const qreal rowY = m_itemRects.last().y(); + + int index = m_itemRects.count() - 2; + while (index >= 0 && m_itemRects.at(index).bottom() >= rowY) { + m_maximumScrollOffset = qMax(m_maximumScrollOffset, m_itemRects.at(index).bottom()); + --index; + } + m_maximumItemOffset = m_columnCount * m_columnWidth; } else { m_maximumScrollOffset = 0; |
