pass computeColor into shadow control, fix shadow switching types due to invalid shadow color
This commit is contained in:
parent
1a38e0273e
commit
098c6af7ef
7 changed files with 19 additions and 7 deletions
|
|
@ -46,12 +46,12 @@ library.add(
|
|||
const props = defineProps(['modelValue'])
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
const paletteExporter = newExporter({
|
||||
filename: 'pleroma',
|
||||
extension: 'palette.json',
|
||||
filename: 'pleroma_palette',
|
||||
extension: 'json',
|
||||
getExportedObject: () => props.modelValue
|
||||
})
|
||||
const paletteImporter = newImporter({
|
||||
accept: '.palette.json',
|
||||
accept: '.json',
|
||||
onImport (parsed, filename) {
|
||||
emit('update:modelValue', parsed)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -620,7 +620,6 @@ export default {
|
|||
}
|
||||
}
|
||||
case 'color':
|
||||
console.log('COLOR', selectedVirtualDirective.value.value)
|
||||
return selectedVirtualDirective.value.value
|
||||
default:
|
||||
return selectedVirtualDirective.value.value
|
||||
|
|
|
|||
|
|
@ -409,6 +409,7 @@
|
|||
<ShadowControl
|
||||
v-if="selectedVirtualDirectiveValType === 'shadow'"
|
||||
v-model="selectedVirtualDirectiveParsed"
|
||||
:computeColor="computeColor"
|
||||
:compact="true"
|
||||
/>
|
||||
<ColorInput
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ export default {
|
|||
'separateInset',
|
||||
'noPreview',
|
||||
'disabled',
|
||||
'computeColor',
|
||||
'compact'
|
||||
],
|
||||
emits: ['update:modelValue', 'subShadowSelected'],
|
||||
|
|
@ -107,6 +108,13 @@ export default {
|
|||
usingFallback () {
|
||||
return this.modelValue == null
|
||||
},
|
||||
getFallback () {
|
||||
if (typeof this.computeColor === 'function' && this.selected?.color) {
|
||||
return this.computeColor(this.selected.color)
|
||||
} else {
|
||||
return this.currentFallback?.color
|
||||
}
|
||||
},
|
||||
style () {
|
||||
try {
|
||||
if (this.separateInset) {
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@
|
|||
:model-value="selected?.color"
|
||||
:disabled="disabled || !present"
|
||||
:label="$t('settings.style.common.color')"
|
||||
:fallback="currentFallback?.color"
|
||||
:fallback="getFallback"
|
||||
:show-optional-tickbox="false"
|
||||
name="shadow"
|
||||
@update:modelValue="e => updateProperty('color', e)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue