X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d49c1d89f9c884aca6a92f8b90ddb245a635d43f..b5432d60372e2dad6d31cd4e6d28e4da5d47a7e4:/src/sidebartreeview.cpp diff --git a/src/sidebartreeview.cpp b/src/sidebartreeview.cpp index d1f6d45b4..0b18c260a 100644 --- a/src/sidebartreeview.cpp +++ b/src/sidebartreeview.cpp @@ -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);