diff options
| author | Peter Penz <[email protected]> | 2007-07-18 20:36:03 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-07-18 20:36:03 +0000 |
| commit | 71158bc65d366e1b02a6d6030b5b12afdca43bd1 (patch) | |
| tree | 85bf51250c18e6472aed1b9b572bab38b635c2ea /src/dolphiniconsview.cpp | |
| parent | 381b494e6c801ad77fc182f58df620f380af5e82 (diff) | |
respect the item width and item height also when the item categorization has been enabled
svn path=/trunk/KDE/kdebase/apps/; revision=689663
Diffstat (limited to 'src/dolphiniconsview.cpp')
| -rw-r--r-- | src/dolphiniconsview.cpp | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp index 394dae317..37f0bf172 100644 --- a/src/dolphiniconsview.cpp +++ b/src/dolphiniconsview.cpp @@ -97,35 +97,31 @@ DolphinIconsView::~DolphinIconsView() QRect DolphinIconsView::visualRect(const QModelIndex& index) const { - if (itemCategorizer() == 0) { - const bool leftToRightFlow = (flow() == QListView::LeftToRight); + const bool leftToRightFlow = (flow() == QListView::LeftToRight); - QRect itemRect = KCategorizedView::visualRect(index); - const int maxWidth = m_itemSize.width(); - const int maxHeight = m_itemSize.height(); + QRect itemRect = KCategorizedView::visualRect(index); + const int maxWidth = m_itemSize.width(); + const int maxHeight = m_itemSize.height(); - if (itemRect.width() > maxWidth) { - // assure that the maximum item width is not exceeded - if (leftToRightFlow) { - const int left = itemRect.left() + (itemRect.width() - maxWidth) / 2; - itemRect.setLeft(left); - } - itemRect.setWidth(maxWidth); + if (itemRect.width() > maxWidth) { + // assure that the maximum item width is not exceeded + if (leftToRightFlow) { + const int left = itemRect.left() + (itemRect.width() - maxWidth) / 2; + itemRect.setLeft(left); } + itemRect.setWidth(maxWidth); + } - if (itemRect.height() > maxHeight) { - // assure that the maximum item height is not exceeded - if (!leftToRightFlow) { - const int top = itemRect.top() + (itemRect.height() - maxHeight) / 2; - itemRect.setTop(top); - } - itemRect.setHeight(maxHeight); + if (itemRect.height() > maxHeight) { + // assure that the maximum item height is not exceeded + if (!leftToRightFlow) { + const int top = itemRect.top() + (itemRect.height() - maxHeight) / 2; + itemRect.setTop(top); } - - return itemRect; + itemRect.setHeight(maxHeight); } - return KCategorizedView::visualRect(index); + return itemRect; } QStyleOptionViewItem DolphinIconsView::viewOptions() const |
