mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 09:35:08 -07:00
[AppColors] Address review comments
- PaletteEditorDialog::onSave(): compare whole PaletteConfig (colors and appColors) so a change to only AccentStrong/AccentSoft writes the file; add PaletteConfig::operator==. - appColor(): derive both roles from QPalette::Highlight unconditionally. The Fusion palettes pin Accent to near-Window values, and QPalette::Accent only exists on Qt 6.6+, so keying on it made identical themes render very differently across Qt versions. - themeChangedSlot(): merge the theme default's [AppColors] into a custom palette that predates the section instead of all-or-nothing per file; hasPalette() now counts an appColors-only file as a palette. - Add Default/palette-default-light.toml so the Default theme's Light scheme keeps the classic greens instead of falling back to the OS accent. - home_widget: restore the isBuiltInTheme() half of the Automatic condition; non-built-in themes extract button colors from their own background art. - palette_grid_widget: use appEnum.value(i) for the role cast (3 sites), append appHeader to headerLabels, fix the 'Lighted' typo.
This commit is contained in:
parent
ea09f92029
commit
b63431ef0d
7 changed files with 107 additions and 19 deletions
|
|
@ -124,10 +124,13 @@ QPair<QColor, QColor> HomeWidget::determineButtonColor() const
|
|||
|
||||
switch (colorSource) {
|
||||
case HomeTabButtonColor::Automatic: {
|
||||
if (usesThemeBackground()) {
|
||||
// Static theme background: follow the theme's accent colors.
|
||||
if (usesThemeBackground() && themeManager->isBuiltInTheme()) {
|
||||
// Built-in themes paint a static theme background; follow the
|
||||
// theme's identity accent colors rather than sampling the image.
|
||||
return paletteDerivedButtonColors();
|
||||
} else {
|
||||
// Non-built-in themes may ship their own background art, so
|
||||
// extract the button colors from the image actually painted.
|
||||
return extractDominantColors(background);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue