]> cloud.milkyroute.net Git - dolphin.git/commitdiff
respect the item width and item height also when the item categorization has been...
authorPeter Penz <peter.penz19@gmail.com>
Wed, 18 Jul 2007 20:36:03 +0000 (20:36 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 18 Jul 2007 20:36:03 +0000 (20:36 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=689663

src/dolphiniconsview.cpp

index 394dae3177a19ec1f5a774f0f60c8b254c27d61d..37f0bf1727cb27a95db7b370e29784281ad94cf4 100644 (file)
@@ -97,35 +97,31 @@ DolphinIconsView::~DolphinIconsView()
 
 QRect DolphinIconsView::visualRect(const QModelIndex& index) const
 {
-    if (itemCategorizer() == 0) {
-        const bool leftToRightFlow = (flow() == QListView::LeftToRight);
-
-        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);
-        }
+    const bool leftToRightFlow = (flow() == QListView::LeftToRight);
 
-        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);
+    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);
+    }
 
-        return itemRect;
+    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);
     }
 
-    return KCategorizedView::visualRect(index);
+    return itemRect;
 }
 
 QStyleOptionViewItem DolphinIconsView::viewOptions() const