[Home] Replace 'Automatic' button color with explicit theme colors default

The Automatic option gated on isBuiltInTheme(): built-in themes used the
theme's accent colors, while non-built-in themes extracted colors from
their own background art. That made the result depend on the theme's
origin rather than what the user actually sees.

Remove Automatic and expose two explicit choices: 'From theme colors'
(always the theme's identity accents, now the default) and 'Extract from
background' (always sample the painted background). Drop the now-unused
isBuiltInTheme() helper.
This commit is contained in:
Lukas Brübach 2026-09-11 20:34:52 +02:00 committed by GitHub
parent a127ff7e1b
commit 21db8c34c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 23 deletions

View file

@ -106,12 +106,6 @@ void HomeWidget::loadBackgroundSourceDeck()
backgroundSourceDeck = deckOpt.has_value() ? deckOpt.value().deckList : DeckList();
}
static bool usesThemeBackground()
{
QString sourceId = SettingsCache::instance().appearance().getHomeTabBackgroundSource();
return BackgroundSources::fromId(sourceId) == BackgroundSources::Theme;
}
static QPair<QColor, QColor> paletteDerivedButtonColors()
{
return {themeManager->appColor(AppColor::AccentStrong), themeManager->appColor(AppColor::AccentSoft)};
@ -123,17 +117,8 @@ QPair<QColor, QColor> HomeWidget::determineButtonColor() const
HomeTabButtonColor::intToSource(SettingsCache::instance().appearance().getHomeTabButtonColorSourceIndex());
switch (colorSource) {
case HomeTabButtonColor::Automatic: {
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);
}
}
case HomeTabButtonColor::FromThemeColors:
return paletteDerivedButtonColors();
case HomeTabButtonColor::FromBackground:
return extractDominantColors(background);
}