]> Devoid-pointer.net GitWeb - anyanka.git/commitdiff
Copy palette colors from the containing widget instead of palette for
authorMichal Malý <madcatxster@devoid-pointer.net>
Sat, 18 Apr 2015 00:25:40 +0000 (02:25 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Sat, 18 Apr 2015 00:25:40 +0000 (02:25 +0200)
disabled role

gui/exportrawdatadialog.cpp

index 47544e1881459ae1170d82776451d26e38d3e873..68f256af3deccbb423f3dd0c39ccd6adaed30863 100644 (file)
@@ -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()));