Skip to content

Commit 1b414b7

Browse files
committed
Avoid style-sheet inheritance in colour chooser boxes in Preferences
This avoid propagating the style-sheet to other widgets. For example, to the tool-tip shown in the frame. But it could also fixed the problem reported for Windows in issue #1493: "Editing color preferences dialog background takes the last chosen color." "Color dialog becomes obscured by the changing color patterns of each selection."
1 parent e9d8af6 commit 1b414b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PreferencesDialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,13 +509,13 @@ void PreferencesDialog::setColorSetting(QFrame *frame, const QColor &color)
509509
palette.setColor(frame->backgroundRole(), color);
510510
frame->setPalette(palette);
511511

512-
frame->setStyleSheet(QString("background-color: %2").arg(color.name()));
512+
frame->setStyleSheet(QString(".QFrame {background-color: %2}").arg(color.name()));
513513

514514
palette = line->palette();
515515
palette.setColor(role, color);
516516
line->setPalette(palette);
517517

518-
line->setStyleSheet(QString("color: %1; background-color: %2").arg(palette.color(line->foregroundRole()).name(),
518+
line->setStyleSheet(QString(".QLineEdit {color: %1; background-color: %2}").arg(palette.color(line->foregroundRole()).name(),
519519
palette.color(line->backgroundRole()).name()));
520520
}
521521

0 commit comments

Comments
 (0)