make active tab to jut out slightly to indicate that it's active (inspired by winMe)

This commit is contained in:
Henry Jameson 2024-11-12 21:05:56 +02:00
parent 311d935943
commit 7c947115e2
3 changed files with 60 additions and 3 deletions

View file

@ -8,7 +8,7 @@
class="label" class="label"
:class="{ faint: !present || disabled }" :class="{ faint: !present || disabled }"
> >
{{ $t('settings.style.common.opacity') }} {{ label }}
</label> </label>
<Checkbox <Checkbox
v-if="typeof fallback !== 'undefined'" v-if="typeof fallback !== 'undefined'"
@ -39,7 +39,7 @@ export default {
Checkbox Checkbox
}, },
props: [ props: [
'name', 'modelValue', 'fallback', 'disabled' 'name', 'label', 'modelValue', 'fallback', 'disabled'
], ],
emits: ['update:modelValue'], emits: ['update:modelValue'],
computed: { computed: {

View file

@ -0,0 +1,51 @@
<template>
<div
class="roundness-control style-control"
:class="{ disabled: !present || disabled }"
>
<label
:for="name"
class="label"
:class="{ faint: !present || disabled }"
>
{{ label }}
</label>
<Checkbox
v-if="typeof fallback !== 'undefined'"
:model-value="present"
:disabled="disabled"
class="opt"
@update:modelValue="$emit('update:modelValue', !present ? fallback : undefined)"
/>
<input
:id="name"
class="input input-number"
type="number"
:value="modelValue || fallback"
:disabled="!present || disabled"
:class="{ disabled: !present || disabled }"
max="999"
min="0"
step="1"
@input="$emit('update:modelValue', $event.target.value)"
>
</div>
</template>
<script>
import Checkbox from '../checkbox/checkbox.vue'
export default {
components: {
Checkbox
},
props: [
'name', 'label', 'modelValue', 'fallback', 'disabled'
],
emits: ['update:modelValue'],
computed: {
present () {
return typeof this.modelValue !== 'undefined'
}
}
}
</script>

View file

@ -119,7 +119,7 @@
.tab { .tab {
flex: 1; flex: 1;
box-sizing: content-box; box-sizing: content-box;
min-width: 10em; max-width: 9em;
min-width: 1px; min-width: 1px;
border-top-right-radius: 0; border-top-right-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
@ -128,6 +128,11 @@
margin-right: -200px; margin-right: -200px;
margin-left: 1em; margin-left: 1em;
&:not(.active) {
margin-top: 0;
margin-left: 1.5em;
}
@media all and (max-width: 800px) { @media all and (max-width: 800px) {
padding-left: 0.25em; padding-left: 0.25em;
padding-right: calc(0.25em + 200px); padding-right: calc(0.25em + 200px);
@ -181,6 +186,7 @@
&:not(.active) { &:not(.active) {
z-index: 4; z-index: 4;
margin-top: 0.25em;
&:hover { &:hover {
z-index: 6; z-index: 6;