From 5f60a87d65cba50e95105b2be63dc8522f7a9d7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Sat, 18 Apr 2015 02:25:40 +0200 Subject: [PATCH] Copy palette colors from the containing widget instead of palette for disabled role --- gui/exportrawdatadialog.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gui/exportrawdatadialog.cpp b/gui/exportrawdatadialog.cpp index 47544e1..68f256a 100644 --- a/gui/exportrawdatadialog.cpp +++ b/gui/exportrawdatadialog.cpp @@ -42,10 +42,11 @@ ExportRawDataDialog::ExportRawDataDialog(QWidget* parent) : ui->qlv_availableSignals->setSizeAdjustPolicy(QListView::AdjustToContents); /* Make the background of availableSignals view the same color as the widget base */ - QPalette oldPalette(ui->qlv_availableSignals->palette()); - QPalette newPalette(oldPalette); - newPalette.setColor(QPalette::Inactive, QPalette::Base, oldPalette.color(QPalette::Disabled, QPalette::Base)); - newPalette.setColor(QPalette::Active, QPalette::Base, oldPalette.color(QPalette::Disabled, QPalette::Base)); + QPalette widgetPalette(this->palette()); + QPalette newPalette(ui->qlv_availableSignals->palette()); + newPalette.setColor(QPalette::Disabled, QPalette::Base, widgetPalette.color(QPalette::Disabled, QPalette::Window)); + newPalette.setColor(QPalette::Inactive, QPalette::Base, widgetPalette.color(QPalette::Inactive, QPalette::Window)); + newPalette.setColor(QPalette::Active, QPalette::Base, widgetPalette.color(QPalette::Active, QPalette::Window)); ui->qlv_availableSignals->setPalette(newPalette); connect(ui->qpb_browse, SIGNAL(clicked()), this, SLOT(onBrowseClicked())); -- 2.43.5