fix(settings): restore Windows panel palette roles

Signed-off-by: Rello <[email protected]>

Assisted-by: Codex:GPT-5
This commit is contained in:
Rello authored and Rello committed 2026-09-16 09:29:51 +02:00
1 parent 47e24210b3
commit ee4bc49e1b
2 files changed
+17 -3

No files matched your search

+8 -3
View File
@@ -547,9 +547,14 @@ void SettingsDialog::customizeStyle()
const QScopedValueRollback<bool> updatingStyle(_updatingStyle, true);
_toolBar->setStyleSheet(TOOLBAR_CSS);
#ifdef Q_OS_WIN
const auto windowColor = QStringLiteral("palette(window)");
const auto panelColor = QStringLiteral("palette(alternate-base)");
#else
const auto applicationPalette = QGuiApplication::palette();
const auto windowColor = applicationPalette.color(QPalette::Window);
const auto panelColor = Theme::settingsPanelColor(applicationPalette);
const auto windowColor = applicationPalette.color(QPalette::Window).name();
const auto panelColor = Theme::settingsPanelColor(applicationPalette).name();
#endif
auto separatorColor = palette().color(QPalette::Mid);
separatorColor.setAlpha(48);
@@ -606,7 +611,7 @@ void SettingsDialog::customizeStyle()
" min-height: 1px;"
" max-height: 1px;"
" }")
.arg(separatorCss, panelColor.name(), windowColor.name()));
.arg(separatorCss, panelColor, windowColor));
auto colorAwareActions = _actionGroup->actions();
if (_addAccountAction) {
+9
View File
@@ -56,12 +56,17 @@ private Q_SLOTS:
QTest::addColumn<QColor>("candidate");
QTest::addColumn<QColor>("expected");
#ifdef Q_OS_WIN
QTest::newRow("light") << QColor(Qt::white) << QColor(Qt::black) << QColor("#f7f7f7") << QColor("#f7f7f7");
QTest::newRow("dark") << QColor("#202020") << QColor(Qt::white) << QColor("#404040") << QColor("#404040");
#else
QTest::newRow("white") << QColor(Qt::white) << QColor(Qt::black) << QColor(Qt::white) << QColor("#f7f7f7");
QTest::newRow("almost-white") << QColor(Qt::white) << QColor(Qt::black) << QColor("#fdfdfd") << QColor("#f7f7f7");
QTest::newRow("black") << QColor(Qt::black) << QColor(Qt::white) << QColor(Qt::black) << QColor("#0f0f0f");
QTest::newRow("dark") << QColor("#202020") << QColor(Qt::white) << QColor("#202020") << QColor("#2d2d2d");
QTest::newRow("preserve-light") << QColor(Qt::white) << QColor(Qt::black) << QColor("#f7f7f7") << QColor("#f7f7f7");
QTest::newRow("preserve-dark") << QColor("#202020") << QColor(Qt::white) << QColor("#404040") << QColor("#404040");
#endif
}
void panelColors()
@@ -98,7 +103,11 @@ private Q_SLOTS:
for (const auto dark : {false, true, false}) {
const auto background = QColor(dark ? "#202020" : "#ffffff");
#ifdef Q_OS_WIN
const auto expected = background;
#else
const auto expected = QColor(dark ? "#2d2d2d" : "#f7f7f7");
#endif
auto palette = _originalPalette;
palette.setColor(QPalette::Window, background);
palette.setColor(QPalette::WindowText, dark ? Qt::white : Qt::black);