]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kcategorizedview.cpp
Clarify some adjectives.
[dolphin.git] / src / kcategorizedview.cpp
index cc83e2de9633c5a38eaf8049794ffd81923e8963..214fa39d236ea23df61ed2ad273673df03b1f12a 100644 (file)
@@ -202,14 +202,27 @@ QRect KCategorizedView::Private::visualRectInViewport(const QModelIndex &index)
         if (rows - trunc(rows)) rowsInt++;
 
         retRect.setTop(retRect.top() +
-                       (rowsInt * listView->spacing()) +
                        (rowsInt * itemHeight) +
                        itemCategorizer->categoryHeight(listView->viewOptions()) +
                        listView->spacing() * 2);
+
+        if (listView->gridSize().isEmpty())
+        {
+            retRect.setTop(retRect.top() +
+                           (rowsInt * listView->spacing()));
+        }
     }
 
-    retRect.setTop(retRect.top() + row * listView->spacing() +
-                   row * itemHeight);
+
+    if (listView->gridSize().isEmpty())
+    {
+        retRect.setTop(retRect.top() + row * listView->spacing() +
+                       (row * itemHeight));
+    }
+    else
+    {
+        retRect.setTop(retRect.top() + (row * itemHeight));
+    }
 
     retRect.setWidth(itemWidth);
 
@@ -273,10 +286,15 @@ QRect KCategorizedView::Private::visualCategoryRectInViewport(const QString &cat
         if (rows - trunc(rows)) rowsInt++;
 
         retRect.setTop(retRect.top() +
-                       (rowsInt * listView->spacing()) +
                        (rowsInt * itemHeight) +
                        itemCategorizer->categoryHeight(listView->viewOptions()) +
                        listView->spacing() * 2);
+
+        if (listView->gridSize().isEmpty())
+        {
+            retRect.setTop(retRect.top() +
+                           (rowsInt * listView->spacing()));
+        }
     }
 
     retRect.setHeight(itemCategorizer->categoryHeight(listView->viewOptions()));