diff options
| author | Peter Penz <[email protected]> | 2012-02-07 17:16:10 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-02-07 17:18:47 +0100 |
| commit | a3a19f4a06b41ac4d89fb1024a9e5d5cb420691d (patch) | |
| tree | 5b6fa99a0111e1c3e4ee40cdb40c9b1d443ad823 /src | |
| parent | 5369ee6819a26d9d3f106521c525c03f81a943ce (diff) | |
Compact view: Don't hide items at the bottom when grouping is turned on
When grouping has been turned on, it was possible that items aligned
at the bottom have been hidden.
BUG: 291640
FIXED-IN: 4.8.1
Diffstat (limited to 'src')
| -rw-r--r-- | src/kitemviews/kitemlistviewlayouter.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/kitemviews/kitemlistviewlayouter.cpp b/src/kitemviews/kitemlistviewlayouter.cpp index 4e7a91087..e30c9aa42 100644 --- a/src/kitemviews/kitemlistviewlayouter.cpp +++ b/src/kitemviews/kitemlistviewlayouter.cpp @@ -277,13 +277,24 @@ void KItemListViewLayouter::doLayout() QSizeF itemSize = m_itemSize; QSizeF size = m_size; + + const bool grouped = createGroupHeaders(); const bool horizontalScrolling = (m_scrollOrientation == Qt::Horizontal); if (horizontalScrolling) { + // Flip everything so that the layout logically can work like having + // a vertical scrolling itemSize.setWidth(m_itemSize.height()); itemSize.setHeight(m_itemSize.width()); size.setWidth(m_size.height()); size.setHeight(m_size.width()); + + if (grouped) { + // In the horizontal scrolling case all groups are aligned + // at the top, which decreases the available height. For the + // flipped data this means that the width must be decreased. + size.rwidth() -= m_groupHeaderHeight; + } } m_columnWidth = itemSize.width(); @@ -311,8 +322,6 @@ void KItemListViewLayouter::doLayout() qreal y = m_headerHeight; int rowIndex = 0; - const bool grouped = createGroupHeaders(); - int index = 0; while (index < itemCount) { qreal x = m_xPosInc; |
