feat: color the color button icon instead of the button itself
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
kolaente 2022-09-14 18:56:51 +02:00
parent 51c806c12b
commit bdf992c9bf
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 20 additions and 6 deletions

View File

@ -9,9 +9,16 @@
} }
]" ]"
> >
<icon :icon="icon" v-if="showIconOnly"/> <icon
v-if="showIconOnly"
:icon="icon"
:style="{'color': iconColor !== '' ? iconColor : false}"
/>
<span class="icon is-small" v-else-if="icon !== ''"> <span class="icon is-small" v-else-if="icon !== ''">
<icon :icon="icon"/> <icon
:icon="icon"
:style="{'color': iconColor !== '' ? iconColor : false}"
/>
</span> </span>
<slot /> <slot />
</BaseButton> </BaseButton>
@ -42,6 +49,10 @@ const props = defineProps({
type: [String, Array], type: [String, Array],
default: '', default: '',
}, },
iconColor: {
type: String,
default: '',
},
loading: { loading: {
type: Boolean, type: Boolean,
default: false, default: false,

View File

@ -378,9 +378,8 @@
@click="setFieldActive('color')" @click="setFieldActive('color')"
variant="secondary" variant="secondary"
icon="fill-drip" icon="fill-drip"
:icon-color="color"
v-shortcut="'c'" v-shortcut="'c'"
:class="{'has-light-text': color !== TASK_DEFAULT_COLOR && !colorIsDark(color)}"
:style="{'background-color': color !== TASK_DEFAULT_COLOR ? color : false}"
> >
{{ $t('task.detail.actions.color') }} {{ $t('task.detail.actions.color') }}
</x-button> </x-button>
@ -600,9 +599,13 @@ export default defineComponent({
return this.$route.name.includes('kanban') return this.$route.name.includes('kanban')
}, },
color() { color() {
return this.task.getHexColor const color = this.task.getHexColor
? this.task.getHexColor() ? this.task.getHexColor()
: TASK_DEFAULT_COLOR : false
return color === TASK_DEFAULT_COLOR
? ''
: color
}, },
}, },
methods: { methods: {