diff options
| author | Peter Penz <[email protected]> | 2011-10-08 22:46:37 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-10-08 22:47:52 +0200 |
| commit | 8d44ebc1487b9dc714b085ee8d3733a187abf8bb (patch) | |
| tree | b892d233f66c9b62c167bc068213b7c566423780 /src/kitemviews/kitemlistview.cpp | |
| parent | 0e8ba413f4b9b479f1196f1433ec74274e5ea95d (diff) | |
Details-view: Fix column-width issue
The column-width must respect the minimum width of the
header-roles.
Diffstat (limited to 'src/kitemviews/kitemlistview.cpp')
| -rw-r--r-- | src/kitemviews/kitemlistview.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 08c92e551..93baa1334 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -1459,8 +1459,20 @@ void KItemListView::updateVisibleRolesSizes(const KItemRangeList& itemRanges) } if (itemCount == rangesItemCount) { - // The sizes of all roles need to be determined m_visibleRolesSizes = visibleRolesSizes(itemRanges); + + // Assure the the sizes are not smaller than the minimum defined by the header + // TODO: Currently only implemented for a top-aligned header + const qreal minHeaderRoleWidth = m_header->minimumRoleWidth(); + QMutableHashIterator<QByteArray, QSizeF> it (m_visibleRolesSizes); + while (it.hasNext()) { + it.next(); + const QSizeF& size = it.value(); + if (size.width() < minHeaderRoleWidth) { + const QSizeF newSize(minHeaderRoleWidth, size.height()); + m_visibleRolesSizes.insert(it.key(), newSize); + } + } } else { // Only a sub range of the roles need to be determined. // The chances are good that the sizes of the sub ranges @@ -1483,7 +1495,7 @@ void KItemListView::updateVisibleRolesSizes(const KItemRangeList& itemRanges) if (!updateRequired) { // All the updated sizes are smaller than the current sizes and no change - // of the roles-widths is required + // of the stretched roles-widths is required return; } } |
