Description: Use window text color for places view Author: tsujan Origin: upstream Bug: https://github.com/lxqt/pcmanfm-qt/issues/696 Applied-Upstream: commit:87df010 Last-Update: 2018-07-14 --- a/src/folderitemdelegate.cpp +++ b/src/folderitemdelegate.cpp @@ -361,7 +361,8 @@ QWidget* FolderItemDelegate::createEdito // ensure that its background isn't transparent (on the side-pane) QWidget* editor = QStyledItemDelegate::createEditor(parent, option, index); QPalette p = editor->palette(); - p.setColor(QPalette::Base, QApplication::palette().color(QPalette::Base)); + p.setColor(QPalette::Text, qApp->palette().text().color()); + p.setColor(QPalette::Base, qApp->palette().color(QPalette::Base)); editor->setPalette(p); return editor; } --- a/src/placesview.cpp +++ b/src/placesview.cpp @@ -131,13 +131,6 @@ PlacesView::PlacesView(QWidget* parent): setHeaderHidden(true); setIndentation(12); - /* merge with the surroundings */ - setFrameShape(QFrame::NoFrame); - QPalette p = palette(); - p.setColor(QPalette::Base, QColor(Qt::transparent)); - setPalette(p); - viewport()->setAutoFillBackground(false); - connect(this, &QTreeView::clicked, this, &PlacesView::onClicked); connect(this, &QTreeView::pressed, this, &PlacesView::onPressed); --- a/src/sidepane.cpp +++ b/src/sidepane.cpp @@ -158,6 +158,15 @@ void SidePane::setMode(Mode mode) { switch(mode) { case ModePlaces: { PlacesView* placesView = new Fm::PlacesView(this); + + // visually merge it with its surroundings + placesView->setFrameShape(QFrame::NoFrame); + QPalette p = placesView->palette(); + p.setColor(QPalette::Base, QColor(Qt::transparent)); + p.setColor(QPalette::Text, p.color(QPalette::WindowText)); + placesView->setPalette(p); + placesView->viewport()->setAutoFillBackground(false); + view_ = placesView; placesView->restoreHiddenItems(restorableHiddenPlaces_); placesView->setIconSize(iconSize_);