style: add icon to the playback speed setting
All checks were successful
repod / xml (push) Successful in 35s
repod / php (push) Successful in 1m8s
repod / nodejs (push) Successful in 2m17s
repod / release (push) Has been skipped

This commit is contained in:
Michel Roux 2024-01-17 17:40:26 +01:00
parent ce5408395d
commit c101588eaf

View File

@ -1,8 +1,13 @@
<template>
<NcAppNavigationSettings>
<div class="setting">
<label id="">{{ t('repod', 'Playback speed') }}</label>
<div class="buttons">
<label>
<SpeedometerSlow v-if="player.rate < 1" />
<SpeedometerMedium v-if="player.rate === 1" />
<Speedometer v-if="player.rate > 1" />
{{ t('repod', 'Playback speed') }}
</label>
<div>
<Minus :size="20" @click="changeRate(-.5)" />
<NcCounterBubble>x{{ player.rate }}</NcCounterBubble>
<Plus :size="20" @click="changeRate(.5)" />
@ -15,6 +20,9 @@
import { NcAppNavigationSettings, NcCounterBubble } from '@nextcloud/vue'
import Minus from 'vue-material-design-icons/Minus.vue'
import Plus from 'vue-material-design-icons/Plus.vue'
import Speedometer from 'vue-material-design-icons/Speedometer.vue'
import SpeedometerMedium from 'vue-material-design-icons/SpeedometerMedium.vue'
import SpeedometerSlow from 'vue-material-design-icons/SpeedometerSlow.vue'
export default {
name: 'Settings',
@ -23,6 +31,9 @@ export default {
NcAppNavigationSettings,
NcCounterBubble,
Plus,
Speedometer,
SpeedometerMedium,
SpeedometerSlow,
},
computed: {
player() {
@ -31,20 +42,22 @@ export default {
},
methods: {
changeRate(diff) {
if (this.player.rate + diff > 0) {
this.$store.dispatch('player/rate', this.player.rate + diff)
}
},
},
}
</script>
<style scoped>
.buttons {
display: flex;
gap: .5rem;
}
.setting {
display: flex;
justify-content: space-between;
}
.setting > label, .setting > div {
display: flex;
gap: .5rem;
}
</style>