fix: 当部署到服务器上时,不显示桌面歌词切换图标 (#689)

* 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

* hide osdlyrics button if not in electron

* tidy files
This commit is contained in:
Shi Liang 2021-05-24 12:17:49 +08:00 committed by GitHub
parent 2d712eefe1
commit 427806b0d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -14,6 +14,7 @@
padding: 0px;
-webkit-user-select: none;
-webkit-app-region: drag;
background: rgba(0, 0, 0, 0.000);
}
div {
@ -25,7 +26,7 @@
</style>
<title>OSD Lyrics</title>
<script>
const electron = process && process.versions && process.versions.hasOwnProperty('electron') ? window.require('electron') : null;
const electron = (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) ? window.require('electron') : null;
const ipcRenderer = electron ? electron.ipcRenderer : null;
const player_api = window.location.origin + "/player";
const lyrics_api = window.location.origin + "/api/lyric?id=";

View File

@ -96,11 +96,8 @@
<div class="blank"></div>
<div class="container" @click.stop>
<button-icon
v-if="osdState"
:title="$t('player.osdlyrics')"
:class="{
active: osdState,
disabled: !osdState,
}"
@click.native="toggleOSDLyrics"
><svg-icon icon-class="osd-lyrics"
/></button-icon>
@ -215,7 +212,7 @@ export default {
: '';
},
osdState() {
return true; //this.$store.osdlyrics.show || false;
return Boolean(ipcRenderer);
},
},
methods: {