mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 05:38:04 +00:00
feat. OSD Lyrics | 增加桌面歌词功能 (#685)
* Add OSD Lyrics * tidy files * fix OSDLyrics: last line of lyrics not showing, performance * tidy files * make user can resize the lyrics window * Fix bug of initial window size * Fix: 1. auto resize osdlyrics window after packaging; 2. lyric parser problem with %; * tidy files
This commit is contained in:
parent
d464e30d83
commit
85592142af
10 changed files with 405 additions and 5 deletions
|
|
@ -95,6 +95,15 @@
|
|||
<div class="right-control-buttons">
|
||||
<div class="blank"></div>
|
||||
<div class="container" @click.stop>
|
||||
<button-icon
|
||||
:title="$t('player.osdlyrics')"
|
||||
:class="{
|
||||
active: osdState,
|
||||
disabled: !osdState,
|
||||
}"
|
||||
@click.native="toggleOSDLyrics"
|
||||
><svg-icon icon-class="osd-lyrics"
|
||||
/></button-icon>
|
||||
<button-icon
|
||||
:title="$t('player.nextUp')"
|
||||
:class="{
|
||||
|
|
@ -168,6 +177,10 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
const electron =
|
||||
process.env.IS_ELECTRON === true ? window.require('electron') : null;
|
||||
const ipcRenderer =
|
||||
process.env.IS_ELECTRON === true ? electron.ipcRenderer : null;
|
||||
import { mapState, mapMutations, mapActions } from 'vuex';
|
||||
import '@/assets/css/slider.css';
|
||||
|
||||
|
|
@ -201,10 +214,18 @@ export default {
|
|||
? '音源来自酷我音乐'
|
||||
: '';
|
||||
},
|
||||
osdState() {
|
||||
return true; //this.$store.osdlyrics.show || false;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['toggleLyrics']),
|
||||
...mapActions(['showToast', 'likeATrack']),
|
||||
toggleOSDLyrics() {
|
||||
if (ipcRenderer) {
|
||||
ipcRenderer.send('toggleOSDLyrics');
|
||||
}
|
||||
},
|
||||
goToNextTracksPage() {
|
||||
if (this.player.isPersonalFM) return;
|
||||
this.$route.name === 'next'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue