[HomeTab] Fix incorrect handling of invalid backgroundSource setting

This commit is contained in:
RickyRister 2026-08-23 22:51:25 -07:00
parent a571a9aa04
commit 3e54507a73
2 changed files with 4 additions and 4 deletions

View file

@ -266,8 +266,8 @@ void HomeWidget::updateConnectButton(const ClientStatus status)
QPair<QColor, QColor> HomeWidget::extractDominantColors(const QPixmap &pixmap) QPair<QColor, QColor> HomeWidget::extractDominantColors(const QPixmap &pixmap)
{ {
if (themeManager->isBuiltInTheme() && SettingsCache::instance().appearance().getHomeTabBackgroundSource() == QString sourceId = SettingsCache::instance().appearance().getHomeTabBackgroundSource();
BackgroundSources::toId(BackgroundSources::Theme)) { if (themeManager->isBuiltInTheme() && BackgroundSources::fromId(sourceId) == BackgroundSources::Theme) {
return QPair<QColor, QColor>(QColor::fromRgb(20, 140, 60), QColor::fromRgb(120, 200, 80)); return QPair<QColor, QColor>(QColor::fromRgb(20, 140, 60), QColor::fromRgb(120, 200, 80));
} }

View file

@ -420,8 +420,8 @@ void AppearanceSettingsPage::editPalette()
void AppearanceSettingsPage::updateHomeTabSettingsVisibility() void AppearanceSettingsPage::updateHomeTabSettingsVisibility()
{ {
bool visible = SettingsCache::instance().appearance().getHomeTabBackgroundSource() != QString sourceId = SettingsCache::instance().appearance().getHomeTabBackgroundSource();
BackgroundSources::toId(BackgroundSources::Theme); bool visible = BackgroundSources::fromId(sourceId) != BackgroundSources::Theme;
homeTabBackgroundShuffleFrequencyLabel.setVisible(visible); homeTabBackgroundShuffleFrequencyLabel.setVisible(visible);
homeTabBackgroundShuffleFrequencySpinBox.setVisible(visible); homeTabBackgroundShuffleFrequencySpinBox.setVisible(visible);