From 1bbc98cc8e7e4723d9157396fde834a25213e5bf Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 5 Jul 2026 22:34:09 -0600 Subject: [PATCH] feat(ui): auto-theme settings UI + i18n Repoint the existing auto-theme Settings scaffold from the "System" theme to the new dynamic "Auto (dynamic)" option: - state.slint: add theme-is-auto (distinct from theme-is-system, which stays the native OS-palette follow). - AppearanceSettings.slint: gate the Source dropdown, image picker, detected-DE hint and Regenerate button on theme-is-auto, and drop the placeholder `unsupported` flag now that the rows are functional. - translations: add "Auto theme generation failed" to all 7 catalogs and give the es "Wallpaper Sync" string a proper Mexican-neutral translation. cc --- crates/qbz-ui/translations/de/LC_MESSAGES/qbz-ui.po | 3 +++ crates/qbz-ui/translations/en/LC_MESSAGES/qbz-ui.po | 3 +++ crates/qbz-ui/translations/es/LC_MESSAGES/qbz-ui.po | 5 ++++- crates/qbz-ui/translations/fr/LC_MESSAGES/qbz-ui.po | 3 +++ crates/qbz-ui/translations/ja/LC_MESSAGES/qbz-ui.po | 3 +++ crates/qbz-ui/translations/pt/LC_MESSAGES/qbz-ui.po | 3 +++ crates/qbz-ui/translations/ru/LC_MESSAGES/qbz-ui.po | 3 +++ crates/qbz-ui/ui/settings/AppearanceSettings.slint | 13 +++++-------- crates/qbz-ui/ui/state.slint | 6 ++++-- 9 files changed, 31 insertions(+), 11 deletions(-) diff --git a/crates/qbz-ui/translations/de/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/de/LC_MESSAGES/qbz-ui.po index 66806d383..7ea6d28ab 100644 --- a/crates/qbz-ui/translations/de/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/de/LC_MESSAGES/qbz-ui.po @@ -4370,3 +4370,6 @@ msgstr "Audioausgabefehler" msgid "Direct ALSA device access is blocked inside Flatpak/Snap — switch the audio backend to PipeWire or System Default" msgstr "Direkter ALSA-Gerätezugriff ist in Flatpak/Snap blockiert — Audio-Backend auf PipeWire oder Systemstandard umstellen" + +msgid "Auto theme generation failed" +msgstr "Automatische Themenerstellung fehlgeschlagen" diff --git a/crates/qbz-ui/translations/en/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/en/LC_MESSAGES/qbz-ui.po index 4721c29e3..82fb28cef 100644 --- a/crates/qbz-ui/translations/en/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/en/LC_MESSAGES/qbz-ui.po @@ -136,3 +136,6 @@ msgstr "No labels in your Library yet." msgid "Library Albums" msgstr "Library Albums" + +msgid "Auto theme generation failed" +msgstr "Auto theme generation failed" diff --git a/crates/qbz-ui/translations/es/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/es/LC_MESSAGES/qbz-ui.po index 8a21168cc..29e1a8b42 100644 --- a/crates/qbz-ui/translations/es/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/es/LC_MESSAGES/qbz-ui.po @@ -12,7 +12,7 @@ msgid "System Colors" msgstr "Colores del Sistema" msgid "Wallpaper Sync" -msgstr "Wallpaper Sync" +msgstr "Sincronizar con el fondo" msgid "Custom Image" msgstr "Imagen Personalizada" @@ -4400,3 +4400,6 @@ msgstr "Error de salida de audio" msgid "Direct ALSA device access is blocked inside Flatpak/Snap — switch the audio backend to PipeWire or System Default" msgstr "El acceso directo a dispositivos ALSA está bloqueado dentro de Flatpak/Snap — cambia el backend de audio a PipeWire o al predeterminado del sistema" + +msgid "Auto theme generation failed" +msgstr "Error al generar el tema automático" diff --git a/crates/qbz-ui/translations/fr/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/fr/LC_MESSAGES/qbz-ui.po index 68986ad2d..8c439e1cd 100644 --- a/crates/qbz-ui/translations/fr/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/fr/LC_MESSAGES/qbz-ui.po @@ -4370,3 +4370,6 @@ msgstr "Erreur de sortie audio" msgid "Direct ALSA device access is blocked inside Flatpak/Snap — switch the audio backend to PipeWire or System Default" msgstr "L'accès direct aux périphériques ALSA est bloqué dans Flatpak/Snap — passez le backend audio sur PipeWire ou la sortie système" + +msgid "Auto theme generation failed" +msgstr "Échec de la génération du thème automatique" diff --git a/crates/qbz-ui/translations/ja/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/ja/LC_MESSAGES/qbz-ui.po index dfa87835e..ff5260eb7 100644 --- a/crates/qbz-ui/translations/ja/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/ja/LC_MESSAGES/qbz-ui.po @@ -4359,3 +4359,6 @@ msgstr "オーディオ出力エラー" msgid "Direct ALSA device access is blocked inside Flatpak/Snap — switch the audio backend to PipeWire or System Default" msgstr "Flatpak/Snap 内では ALSA デバイスへの直接アクセスがブロックされます — オーディオバックエンドを PipeWire またはシステム既定に切り替えてください" + +msgid "Auto theme generation failed" +msgstr "自動テーマの生成に失敗しました" diff --git a/crates/qbz-ui/translations/pt/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/pt/LC_MESSAGES/qbz-ui.po index b8a112e2f..b88d4499a 100644 --- a/crates/qbz-ui/translations/pt/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/pt/LC_MESSAGES/qbz-ui.po @@ -4370,3 +4370,6 @@ msgstr "Erro de saída de áudio" msgid "Direct ALSA device access is blocked inside Flatpak/Snap — switch the audio backend to PipeWire or System Default" msgstr "O acesso direto a dispositivos ALSA está bloqueado no Flatpak/Snap — mude o backend de áudio para PipeWire ou o padrão do sistema" + +msgid "Auto theme generation failed" +msgstr "Falha ao gerar o tema automático" diff --git a/crates/qbz-ui/translations/ru/LC_MESSAGES/qbz-ui.po b/crates/qbz-ui/translations/ru/LC_MESSAGES/qbz-ui.po index 1b6aff53b..988057d1c 100644 --- a/crates/qbz-ui/translations/ru/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-ui/translations/ru/LC_MESSAGES/qbz-ui.po @@ -4383,3 +4383,6 @@ msgstr "Ошибка аудиовывода" msgid "Direct ALSA device access is blocked inside Flatpak/Snap — switch the audio backend to PipeWire or System Default" msgstr "Прямой доступ к устройствам ALSA заблокирован в Flatpak/Snap — переключите аудиобэкенд на PipeWire или системный вывод" + +msgid "Auto theme generation failed" +msgstr "Не удалось сгенерировать автоматическую тему" diff --git a/crates/qbz-ui/ui/settings/AppearanceSettings.slint b/crates/qbz-ui/ui/settings/AppearanceSettings.slint index 4bedef1e3..851c6a2a8 100644 --- a/crates/qbz-ui/ui/settings/AppearanceSettings.slint +++ b/crates/qbz-ui/ui/settings/AppearanceSettings.slint @@ -199,9 +199,8 @@ export component AppearanceSettings inherits VerticalLayout { } } - // Auto-Theme controls — only when the "System" theme is selected. - if AppearanceState.theme-is-system: SettingRow { - unsupported: true; + // Auto-Theme controls — only when the "Auto (dynamic)" theme is selected. + if AppearanceState.theme-is-auto: SettingRow { label: @tr("Source"); description: @tr("Generate a color theme from your system wallpaper or a custom image"); QbzSelect { @@ -214,8 +213,7 @@ export component AppearanceSettings inherits VerticalLayout { } } } - if AppearanceState.theme-is-system && AppearanceState.auto-theme-source-index == 2: SettingRow { - unsupported: true; + if AppearanceState.theme-is-auto && AppearanceState.auto-theme-source-index == 2: SettingRow { label: AppearanceState.auto-theme-custom-path != "" ? AppearanceState.auto-theme-custom-path : @tr("Select Image..."); @@ -226,12 +224,11 @@ export component AppearanceSettings inherits VerticalLayout { } } } - if AppearanceState.theme-is-system && AppearanceState.auto-theme-detected-de != "": SettingRow { + if AppearanceState.theme-is-auto && AppearanceState.auto-theme-detected-de != "": SettingRow { label: @tr("Detected: ") + AppearanceState.auto-theme-detected-de; description: @tr("Experimental: theme may not match your system exactly."); } - if AppearanceState.theme-is-system: SettingRow { - unsupported: true; + if AppearanceState.theme-is-auto: SettingRow { label: @tr("Regenerate"); SecondaryButton { label: @tr("Regenerate"); diff --git a/crates/qbz-ui/ui/state.slint b/crates/qbz-ui/ui/state.slint index 71106e6e8..9ba88d467 100644 --- a/crates/qbz-ui/ui/state.slint +++ b/crates/qbz-ui/ui/state.slint @@ -2898,9 +2898,11 @@ export global AppearanceState { in-out property album-header-gradient: true; - // Auto-Theme (shown when the "System" theme is selected). Source: - // 0 = System Colors, 1 = Wallpaper Sync, 2 = Custom Image. + // True while the "System" theme is selected (native OS-palette follow). in-out property theme-is-system: false; + // Auto-Theme (shown when the appended "Auto (dynamic)" theme is selected). + // Source: 0 = System Colors, 1 = Wallpaper Sync, 2 = Custom Image. + in-out property theme-is-auto: false; in-out property <[string]> auto-theme-sources: [@tr("System Colors"), @tr("Wallpaper Sync"), @tr("Custom Image")]; in-out property auto-theme-source-index: 0; in-out property auto-theme-custom-path: "";