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