Took 49 seconds
This commit is contained in:
Lukas Brübach 2026-05-17 09:31:29 +02:00
parent dd78fb7029
commit 4b05e8f8b8
3 changed files with 9 additions and 5 deletions

View file

@ -206,8 +206,9 @@ void PaletteEditorDialog::loadSchemes()
for (auto group : {QPalette::Active, QPalette::Disabled, QPalette::Inactive}) {
for (int i = 0; i < QPalette::NColorRoles; ++i) {
auto role = static_cast<QPalette::ColorRole>(i);
if (role != QPalette::NoRole)
if (role != QPalette::NoRole) {
cfg.colors[group][role] = appPal.color(group, role);
}
}
}
}
@ -219,8 +220,9 @@ void PaletteEditorDialog::loadSchemes()
void PaletteEditorDialog::seedAccentFromScheme(const QString &scheme)
{
QColor seed = workingConfig.value(scheme).colors.value(QPalette::Active).value(QPalette::Highlight);
if (seed.isValid())
if (seed.isValid()) {
quickSetupPanel->setAccentColor(seed);
}
}
void PaletteEditorDialog::onSchemeChanged(const QString &scheme)
@ -321,4 +323,4 @@ void PaletteEditorDialog::refreshChromePalettes()
quickSetupPanel->setPalette(sp);
quickSetupPanel->update();
}
}
}

View file

@ -170,9 +170,10 @@ void PaletteGridWidget::loadPalette(const PaletteConfig &cfg)
PaletteConfig PaletteGridWidget::currentPaletteConfig() const
{
PaletteConfig cfg;
for (auto group : ALL_GROUPS)
for (auto group : ALL_GROUPS) {
for (auto role : allRoles()) {
cfg.colors[group][role] = colorButtons[group][role]->getColor();
}
}
return cfg;
}

View file

@ -279,8 +279,9 @@ void ThemeManager::applyStyleAndPalette(const QString &themeName,
if (styleName.compare("Fusion", Qt::CaseInsensitive) == 0) {
base = style->standardPalette();
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
if (activeScheme == "Dark")
if (activeScheme == "Dark") {
base.setColor(QPalette::AlternateBase, QColor(53, 53, 53));
}
#endif
} else {
base = qApp->palette();