fix palette editor in appearace tab + make it expert
This commit is contained in:
parent
406b973654
commit
0e1c1b04a0
|
@ -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'))
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue