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,11 +206,12 @@ void PaletteEditorDialog::loadSchemes()
for (auto group : {QPalette::Active, QPalette::Disabled, QPalette::Inactive}) { for (auto group : {QPalette::Active, QPalette::Disabled, QPalette::Inactive}) {
for (int i = 0; i < QPalette::NColorRoles; ++i) { for (int i = 0; i < QPalette::NColorRoles; ++i) {
auto role = static_cast<QPalette::ColorRole>(i); auto role = static_cast<QPalette::ColorRole>(i);
if (role != QPalette::NoRole) if (role != QPalette::NoRole) {
cfg.colors[group][role] = appPal.color(group, role); cfg.colors[group][role] = appPal.color(group, role);
} }
} }
} }
}
savedConfig[scheme] = cfg; savedConfig[scheme] = cfg;
workingConfig[scheme] = cfg; workingConfig[scheme] = cfg;
} }
@ -219,8 +220,9 @@ void PaletteEditorDialog::loadSchemes()
void PaletteEditorDialog::seedAccentFromScheme(const QString &scheme) void PaletteEditorDialog::seedAccentFromScheme(const QString &scheme)
{ {
QColor seed = workingConfig.value(scheme).colors.value(QPalette::Active).value(QPalette::Highlight); QColor seed = workingConfig.value(scheme).colors.value(QPalette::Active).value(QPalette::Highlight);
if (seed.isValid()) if (seed.isValid()) {
quickSetupPanel->setAccentColor(seed); quickSetupPanel->setAccentColor(seed);
}
} }
void PaletteEditorDialog::onSchemeChanged(const QString &scheme) void PaletteEditorDialog::onSchemeChanged(const QString &scheme)

View file

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

View file

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