From: Peter Penz Date: Mon, 22 Sep 2008 15:11:50 +0000 (+0000) Subject: make the background transparent and apply the window-text color to the text color... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/b3fa99a39c26445f4846e1d6d321186bb09b0689 make the background transparent and apply the window-text color to the text color, so that enough contrast is given for all color schemes CCMAIL: thomas.luebking@web.de svn path=/trunk/KDE/kdebase/apps/; revision=863584 --- diff --git a/src/sidebartreeview.cpp b/src/sidebartreeview.cpp index 3018737ab..0b18c260a 100644 --- a/src/sidebartreeview.cpp +++ b/src/sidebartreeview.cpp @@ -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);