From e8d0e45b5b19722555b53f9009f8bc01a9ed8640 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 2 Oct 2024 16:22:28 +0300 Subject: [PATCH] it is working. finally. --- .../settings_modal/tabs/appearance_tab.js | 28 ++- .../settings_modal/tabs/appearance_tab.vue | 8 +- src/modules/config.js | 2 + src/modules/interface.js | 184 +++++++++++++----- src/services/style_setter/style_setter.js | 2 +- .../theme_data/theme_data_3.service.js | 6 + static/config.json | 2 +- 7 files changed, 168 insertions(+), 64 deletions(-) diff --git a/src/components/settings_modal/tabs/appearance_tab.js b/src/components/settings_modal/tabs/appearance_tab.js index 503f59b3..247a800e 100644 --- a/src/components/settings_modal/tabs/appearance_tab.js +++ b/src/components/settings_modal/tabs/appearance_tab.js @@ -174,7 +174,11 @@ const AppearanceTab = { }, isCustomThemeUsed () { const { theme } = this.mergedConfig - return theme === 'custom' || theme === null + return theme === 'custom' + }, + isCustomStyleUsed (name) { + const { style } = this.mergedConfig + return style === 'custom' }, ...SharedComputedObject() }, @@ -196,12 +200,26 @@ const AppearanceTab = { const { theme } = this.mergedConfig return key === theme }, - async setTheme (name) { - await this.$store.dispatch('setTheme', name) + isStyleActive (key) { + const { style } = this.mergedConfig + return key === style + }, + isPaletteActive (key) { + const { palette } = this.mergedConfig + return key === palette + }, + setTheme (name) { + this.$store.dispatch('setTheme', name) this.$store.dispatch('applyTheme') }, - async setPalette (name) { - await this.$store.dispatch('setPalette', name) + setPalette (name) { + this.$store.dispatch('setPalette', name) + this.$store.dispatch('applyTheme') + }, + resetTheming (name) { + this.$store.dispatch('resetThemeV2') + this.$store.dispatch('resetThemeV3') + this.$store.dispatch('setStyle', 'stock') this.$store.dispatch('applyTheme') }, previewTheme (key, input) { diff --git a/src/components/settings_modal/tabs/appearance_tab.vue b/src/components/settings_modal/tabs/appearance_tab.vue index 29db1961..164247fc 100644 --- a/src/components/settings_modal/tabs/appearance_tab.vue +++ b/src/components/settings_modal/tabs/appearance_tab.vue @@ -9,7 +9,8 @@