2021-04-13 15:30:16 +02:00
|
|
|
<template>
|
|
|
|
<div>
|
2021-07-24 17:18:28 +02:00
|
|
|
<span class="options-label">{{ $t('settings.item-size-label') }}</span>
|
2021-04-13 15:30:16 +02:00
|
|
|
<div class="display-options">
|
2021-07-24 17:18:28 +02:00
|
|
|
<IconSmall
|
|
|
|
@click="updateIconSize('small')"
|
|
|
|
v-tooltip="tooltip($t('settings.item-size-small'))"
|
|
|
|
:class="`layout-icon ${iconSize === 'small' ? 'selected' : ''}`"
|
|
|
|
tabindex="-2"
|
|
|
|
/>
|
|
|
|
<IconMedium
|
|
|
|
@click="updateIconSize('medium')"
|
|
|
|
v-tooltip="tooltip($t('settings.item-size-medium'))"
|
|
|
|
:class="`layout-icon ${iconSize === 'medium' ? 'selected' : ''}`"
|
|
|
|
tabindex="-2"
|
|
|
|
/>
|
|
|
|
<IconLarge
|
|
|
|
@click="updateIconSize('large')"
|
|
|
|
v-tooltip="tooltip($t('settings.item-size-large'))"
|
|
|
|
:class="`layout-icon ${iconSize === 'large' ? 'selected' : ''}`"
|
|
|
|
tabindex="-2"
|
|
|
|
/>
|
2021-04-13 15:30:16 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-10-26 00:41:05 +02:00
|
|
|
import StoreKeys from '@/utils/StoreMutations';
|
2021-04-17 19:42:38 +02:00
|
|
|
import IconSmall from '@/assets/interface-icons/icon-size-small.svg';
|
|
|
|
import IconMedium from '@/assets/interface-icons/icon-size-medium.svg';
|
|
|
|
import IconLarge from '@/assets/interface-icons/icon-size-large.svg';
|
2021-04-13 15:30:16 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'IconSizeSelector',
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
input: '',
|
|
|
|
};
|
|
|
|
},
|
2024-04-27 16:52:40 +02:00
|
|
|
computed: {
|
|
|
|
iconSize() {
|
|
|
|
return this.$store.getters.iconSize;
|
|
|
|
},
|
2021-04-13 15:30:16 +02:00
|
|
|
},
|
|
|
|
components: {
|
|
|
|
IconSmall,
|
|
|
|
IconMedium,
|
|
|
|
IconLarge,
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
updateIconSize(iconSize) {
|
2021-10-26 00:41:05 +02:00
|
|
|
this.$store.commit(StoreKeys.SET_ITEM_SIZE, iconSize);
|
2021-04-13 15:30:16 +02:00
|
|
|
},
|
2021-04-14 15:31:08 +02:00
|
|
|
tooltip(content) {
|
|
|
|
return { content, trigger: 'hover focus', delay: 250 };
|
|
|
|
},
|
2021-04-13 15:30:16 +02:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
|
|
span.options-label {
|
2021-04-15 20:30:30 +02:00
|
|
|
color: var(--settings-text-color);
|
2021-04-13 15:30:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.display-options {
|
2021-04-15 20:30:30 +02:00
|
|
|
color: var(--settings-text-color);
|
2021-04-13 15:30:16 +02:00
|
|
|
svg {
|
|
|
|
path {
|
2021-04-15 20:30:30 +02:00
|
|
|
fill: var(--settings-text-color);
|
2021-04-13 15:30:16 +02:00
|
|
|
}
|
|
|
|
width: 1rem;
|
|
|
|
height: 1rem;
|
|
|
|
margin: 0.2rem;
|
|
|
|
padding: 0.2rem;
|
|
|
|
text-align: center;
|
|
|
|
background: var(--background);
|
|
|
|
border: 1px solid currentColor;
|
2021-04-14 22:05:37 +02:00
|
|
|
border-radius: var(--curve-factor);
|
2021-04-13 15:30:16 +02:00
|
|
|
cursor: pointer;
|
|
|
|
&:hover, &.selected {
|
2021-04-15 20:30:30 +02:00
|
|
|
background: var(--settings-text-color);
|
2021-04-13 15:30:16 +02:00
|
|
|
path { fill: var(--background); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|