From 0e1c1b04a0fb15cad5e7e937d5f1daade76a3393 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 1 Dec 2024 21:33:24 +0200 Subject: [PATCH] fix palette editor in appearace tab + make it expert --- .../settings_modal/tabs/appearance_tab.js | 19 ++++++++++--------- .../settings_modal/tabs/appearance_tab.vue | 3 ++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/settings_modal/tabs/appearance_tab.js b/src/components/settings_modal/tabs/appearance_tab.js index d314dc78..1e4e64d6 100644 --- a/src/components/settings_modal/tabs/appearance_tab.js +++ b/src/components/settings_modal/tabs/appearance_tab.js @@ -119,6 +119,8 @@ const AppearanceTab = { })) }) + this.userPalette = this.$store.state.interface.paletteDataUsed || {} + updateIndex('palette').then(bundledPalettes => { bundledPalettes.forEach(([key, palettePromise]) => palettePromise.then(v => { let palette @@ -140,10 +142,6 @@ const AppearanceTab = { palette = { key, ...v } } this.bundledPalettes.push(palette) - - if (this.isPaletteActive(key)) { - this.userPalette = palette - } })) }) @@ -169,7 +167,15 @@ const AppearanceTab = { }) }) }, + watch: { + paletteDataUsed () { + this.userPalette = this.paletteDataUsed || {} + } + }, computed: { + paletteDataUsed () { + return this.$store.state.interface.paletteDataUsed + }, availableStyles () { return [ ...this.availableThemesV3, @@ -184,11 +190,6 @@ const AppearanceTab = { }, stylePalettes () { const ruleset = this.$store.state.interface.styleDataUsed || [] - console.log( - 'ASR', - this.$store.state.interface.paletteDataUsed, - this.$store.state.interface.styleDataUsed - ) if (!ruleset && ruleset.length === 0) return const meta = ruleset.find(x => x.component === '@meta') const result = ruleset.filter(x => x.component.startsWith('@palette')) diff --git a/src/components/settings_modal/tabs/appearance_tab.vue b/src/components/settings_modal/tabs/appearance_tab.vue index 5c1c46fe..41fda7b7 100644 --- a/src/components/settings_modal/tabs/appearance_tab.vue +++ b/src/components/settings_modal/tabs/appearance_tab.vue @@ -123,10 +123,11 @@ :style="{ backgroundColor: p[c], border: '1px solid ' + (p[c] ?? 'var(--text)') }" /> -

+

{{ $t('settings.style.themes3.palette.user') }}