mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-07-30 07:44:13 +02:00
Merge pull request #558 from ispyisail/fix/clear-broken-stylesheet
Clear the application stylesheet when using system colors
This commit is contained in:
+9
-5
@@ -1733,11 +1733,15 @@ void QETApp::invertMainWindowVisibility(QWidget *window) {
|
||||
void QETApp::useSystemPalette(bool use) {
|
||||
if (use) {
|
||||
qApp->setPalette(initial_palette_);
|
||||
qApp->setStyleSheet(
|
||||
"QAbstractScrollArea#mdiarea {"
|
||||
"background-color -> setPalette(initial_palette_);"
|
||||
"}"
|
||||
);
|
||||
// Drop any stylesheet previously loaded from style.css: with system
|
||||
// colors requested, the palette set just above is what provides them.
|
||||
//
|
||||
// This used to install a one-rule stylesheet whose only declaration
|
||||
// was invalid CSS ("background-color -> setPalette(initial_palette_);",
|
||||
// a note-to-self committed in e6c32bc0, 2014). It styled nothing, but
|
||||
// a non-empty application stylesheet still wraps every widget in
|
||||
// QStyleSheetStyle, which overrides per-widget QWidget::setStyle().
|
||||
qApp->setStyleSheet(QString());
|
||||
} else {
|
||||
QFile file(configDir() + "/style.css");
|
||||
if (file.open(QFile::ReadOnly)) {
|
||||
|
||||
Reference in New Issue
Block a user