commit: 0e1c1b04a0fb15cad5e7e937d5f1daade76a3393
parent 406b973654650cd09f619c14bbebb297275588f5
Author: Henry Jameson <me@hjkos.com>
Date: Sun, 1 Dec 2024 21:33:24 +0200
fix palette editor in appearace tab + make it expert
Diffstat:
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
@@ -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
@@ -123,10 +123,11 @@
:style="{ backgroundColor: p[c], border: '1px solid ' + (p[c] ?? 'var(--text)') }"
/>
</button>
- <h4>
+ <h4 v-if="expertLevel > 0">
{{ $t('settings.style.themes3.palette.user') }}
</h4>
<PaletteEditor
+ v-if="expertLevel > 0"
class="userPalette"
v-model="userPalette"
:compact="true"