]> cloud.milkyroute.net Git - dolphin.git/commitdiff
make the background transparent and apply the window-text color to the text color...
authorPeter Penz <peter.penz19@gmail.com>
Mon, 22 Sep 2008 15:11:50 +0000 (15:11 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Mon, 22 Sep 2008 15:11:50 +0000 (15:11 +0000)
CCMAIL: thomas.luebking@web.de

svn path=/trunk/KDE/kdebase/apps/; revision=863584

src/sidebartreeview.cpp

index 3018737ab84b683a59012dad331331b56158e836..0b18c260a04ba7c38c9c4320918b7586767c3732 100644 (file)
@@ -46,9 +46,15 @@ SidebarTreeView::SidebarTreeView(QWidget* parent) :
 
     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);