]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kcategorydrawer.cpp
Hooray for perfectionism
[dolphin.git] / src / kcategorydrawer.cpp
index ebe77f4deab5e7bf055984d6c650df1a57d71be5..4c59864a09c3c4c6de615c2f6ffd79fe48430427 100644 (file)
@@ -82,8 +82,10 @@ void KCategoryDrawer::drawCategory(const QModelIndex &index,
 
     QLinearGradient gradient(option.rect.topLeft(),
                              option.rect.bottomRight());
-    gradient.setColorAt(0, color);
-    gradient.setColorAt(1, Qt::transparent);
+    gradient.setColorAt(option.direction == Qt::LeftToRight ? 0
+                                                            : 1, color);
+    gradient.setColorAt(option.direction == Qt::LeftToRight ? 1
+                                                            : 0, Qt::transparent);
 
     painter->setBrush(gradient);
     painter->fillPath(path, gradient);