saving "first style palette" stuff
This commit is contained in:
parent
3f331b53db
commit
b348d22a2b
|
@ -141,11 +141,12 @@ const AppearanceTab = {
|
||||||
cOrange = '#E3FF00'
|
cOrange = '#E3FF00'
|
||||||
] = v
|
] = v
|
||||||
palette = { key, name, bg, fg, text, link, cRed, cBlue, cGreen, cOrange }
|
palette = { key, name, bg, fg, text, link, cRed, cBlue, cGreen, cOrange }
|
||||||
this.bundledPalettes.push()
|
|
||||||
} else {
|
} else {
|
||||||
palette = { key, ...v }
|
palette = { key, ...v }
|
||||||
}
|
}
|
||||||
|
if (!palette.key.startsWith('style.')) {
|
||||||
this.bundledPalettes.push(palette)
|
this.bundledPalettes.push(palette)
|
||||||
|
}
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -214,6 +215,7 @@ const AppearanceTab = {
|
||||||
|
|
||||||
const result = {
|
const result = {
|
||||||
name: `${meta.directives.name || this.$t('settings.style.themes3.palette.imported')}: ${variant}`,
|
name: `${meta.directives.name || this.$t('settings.style.themes3.palette.imported')}: ${variant}`,
|
||||||
|
key: `style.${variant.toLowerCase().replace(/ /g, '_')}`,
|
||||||
bg,
|
bg,
|
||||||
fg,
|
fg,
|
||||||
text,
|
text,
|
||||||
|
|
|
@ -114,8 +114,8 @@
|
||||||
v-for="p in stylePalettes || []"
|
v-for="p in stylePalettes || []"
|
||||||
:key="p.name"
|
:key="p.name"
|
||||||
class="btn button-default palette-entry"
|
class="btn button-default palette-entry"
|
||||||
:class="{ toggled: isPaletteActive('style.' + p.key) }"
|
:class="{ toggled: isPaletteActive(p.key) }"
|
||||||
@click="() => setPaletteCustom(p)"
|
@click="() => setPalette(p.key, p)"
|
||||||
>
|
>
|
||||||
<div class="palette-label">
|
<div class="palette-label">
|
||||||
<label>
|
<label>
|
||||||
|
|
|
@ -482,7 +482,7 @@ const interfaceMod = {
|
||||||
return { name: x.variant, ...cleanDirectives }
|
return { name: x.variant, ...cleanDirectives }
|
||||||
})
|
})
|
||||||
.forEach(palette => {
|
.forEach(palette => {
|
||||||
const key = 'style.' + palette.name.toLowerCase().replace(/ /, '_')
|
const key = 'style.' + palette.name.toLowerCase().replace(/ /g, '_')
|
||||||
if (!firstStylePaletteName) firstStylePaletteName = key
|
if (!firstStylePaletteName) firstStylePaletteName = key
|
||||||
palettesIndex[key] = () => Promise.resolve(palette)
|
palettesIndex[key] = () => Promise.resolve(palette)
|
||||||
})
|
})
|
||||||
|
@ -494,6 +494,10 @@ const interfaceMod = {
|
||||||
state.useStylePalette ? firstStylePaletteName : (userPaletteName || instancePaletteName)
|
state.useStylePalette ? firstStylePaletteName : (userPaletteName || instancePaletteName)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (state.useStylePalette) {
|
||||||
|
commit('setOption', { name: 'palette', value: firstStylePaletteName })
|
||||||
|
}
|
||||||
|
|
||||||
state.paletteNameUsed = palette.nameUsed
|
state.paletteNameUsed = palette.nameUsed
|
||||||
state.paletteDataUsed = palette.dataUsed
|
state.paletteDataUsed = palette.dataUsed
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue