]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/sidebartreeview.cpp
The else path is never reached -> removed it (thanks to Simon St James for the hint)
[dolphin.git] / src / sidebartreeview.cpp
index d1f6d45b4f49dfc06944bafd74af2b1c6087f905..0b18c260a04ba7c38c9c4320918b7586767c3732 100644 (file)
@@ -40,16 +40,21 @@ SidebarTreeView::SidebarTreeView(QWidget* parent) :
     setFrameStyle(QFrame::NoFrame);
     setDragDropMode(QAbstractItemView::DragDrop);
     setDropIndicatorShown(false);
-    setAutoExpandDelay(300);
 
     setVerticalScrollMode(QListView::ScrollPerPixel);
     setHorizontalScrollMode(QListView::ScrollPerPixel);
 
     viewport()->setAttribute(Qt::WA_Hover);
 
-    QPalette palette = viewport()->palette();
-    palette.setColor(viewport()->backgroundRole(), Qt::transparent);
-    viewport()->setPalette(palette);
+    // make the background transparent and apply the window-text color
+    // to the text color, so that enough contrast is given for all color
+    // schemes
+    QPalette p = palette();
+    p.setColor(QPalette::Active,   QPalette::Text, p.color(QPalette::Active,   QPalette::WindowText));
+    p.setColor(QPalette::Inactive, QPalette::Text, p.color(QPalette::Inactive, QPalette::WindowText));
+    p.setColor(QPalette::Disabled, QPalette::Text, p.color(QPalette::Disabled, QPalette::WindowText));
+    setPalette(p);
+    viewport()->setAutoFillBackground(false);
 
     KFileItemDelegate* delegate = new KFileItemDelegate(this);
     setItemDelegate(delegate);