owntone-server/web-src/src/components/PlayerButtonLyrics.vue

45 lines
774 B
Vue
Raw Normal View History

<template>
<a :class="{ 'is-info': is_active }" @click="toggle_lyrics">
<mdicon
class="icon"
:name="icon_name"
:size="icon_size"
:title="$t('player.button.toggle-lyrics')"
/>
</a>
</template>
<script>
2024-08-22 21:31:59 +02:00
import { useLyricsStore } from '@/stores/lyrics'
export default {
name: 'PlayerButtonLyrics',
props: {
icon_size: { default: 16, type: Number }
},
2024-08-22 21:31:59 +02:00
setup() {
return {
lyricsStore: useLyricsStore()
}
},
computed: {
icon_name() {
2023-11-24 16:28:35 +01:00
return this.is_active ? 'script-text-play' : 'script-text-outline'
2024-03-26 15:00:17 +01:00
},
is_active() {
2024-08-22 21:31:59 +02:00
return this.lyricsStore.pane
}
},
methods: {
toggle_lyrics() {
2024-08-22 21:31:59 +02:00
this.lyricsStore.pane = !this.lyricsStore.pane
}
}
}
</script>
<style></style>