From 03d04c4fcb201dbad1825f10a16084e017f0059e Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 6 Jul 2024 23:26:47 +0200 Subject: [PATCH 1/2] fix(theme): fix color change on theme change Signed-off-by: Stefan Dej --- .../settings/SettingsUiSettingsTab.vue | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/components/settings/SettingsUiSettingsTab.vue b/src/components/settings/SettingsUiSettingsTab.vue index dcba86ff4..7f61b96d9 100644 --- a/src/components/settings/SettingsUiSettingsTab.vue +++ b/src/components/settings/SettingsUiSettingsTab.vue @@ -11,7 +11,7 @@ - + @@ -298,7 +298,6 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin, ThemeMixin) mdiRestart = mdiRestart mdiTimerOutline = mdiTimerOutline - defaultPrimaryColor = defaultPrimaryColor defaultBigThumbnailBackground = defaultBigThumbnailBackground get mode() { @@ -309,11 +308,19 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin, ThemeMixin) this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.mode', value: newVal }) } - get theme() { + get themeName() { return this.$store.getters['gui/theme'] } - set theme(newVal: string) { + set themeName(newVal: string) { + const newTheme = themes.find((theme) => theme.name === newVal) + if (this.logoColor === this.defaultLogoColor) { + this.logoColor = newTheme?.colorLogo ?? defaultLogoColor + } + if (this.primaryColor === this.defaultPrimaryColor) { + this.primaryColor = newTheme?.colorPrimary ?? defaultPrimaryColor + } + this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.theme', value: newVal }) } @@ -348,7 +355,12 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin, ThemeMixin) } get defaultLogoColor() { - return themes.find((theme) => theme.name === this.themeName)?.colorLogo ?? defaultLogoColor + window.console.log(this.theme?.colorLogo ?? defaultLogoColor) + return this.theme?.colorLogo ?? defaultLogoColor + } + + get defaultPrimaryColor() { + return this.theme?.colorPrimary ?? defaultPrimaryColor } get primaryColor() { From 46025ab25745d2d86246e3b9649b041c142017aa Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 6 Jul 2024 23:35:28 +0200 Subject: [PATCH 2/2] refactor: remove console.log Signed-off-by: Stefan Dej --- src/components/settings/SettingsUiSettingsTab.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/settings/SettingsUiSettingsTab.vue b/src/components/settings/SettingsUiSettingsTab.vue index 7f61b96d9..0bc26e456 100644 --- a/src/components/settings/SettingsUiSettingsTab.vue +++ b/src/components/settings/SettingsUiSettingsTab.vue @@ -355,7 +355,6 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin, ThemeMixin) } get defaultLogoColor() { - window.console.log(this.theme?.colorLogo ?? defaultLogoColor) return this.theme?.colorLogo ?? defaultLogoColor }