Permalink
Browse files

Use window text color for places view (#214)

* Use window text color for places view

Closes lxqt/pcmanfm-qt#696

* Do Places's visual merging in sidepane code
  • Loading branch information...
tsujan committed Jun 13, 2018
1 parent 71e7f41 commit 87df010ed548856fad8fc822cfb8390ea1118ccc
Showing with 11 additions and 8 deletions.
  1. +2 −1 src/folderitemdelegate.cpp
  2. +0 −7 src/placesview.cpp
  3. +9 −0 src/sidepane.cpp
@@ -372,7 +372,8 @@ QWidget* FolderItemDelegate::createEditor(QWidget* parent, const QStyleOptionVie
// 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;
}
@@ -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);

@@ -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_);

0 comments on commit 87df010

Please sign in to comment.