Merge branch 'dev' into md
commit
f30cb9da59
|
@ -70,6 +70,13 @@ npm run pack
|
|||
|
||||
<p><a href="https://github.com/lyswhut/lx-music-desktop"><img width="100%" src="https://github.com/lyswhut/lx-music-desktop/blob/master/doc/images/app.png" alt="lx-music UI"></a></p>
|
||||
|
||||
### 启动参数
|
||||
|
||||
目前软件已支持的启动参数如下:
|
||||
|
||||
- `-search` 启动软件时自动在搜索框搜索指定的内容,例如:`-search="突然的自我 - 伍佰"`
|
||||
- `-nt` 以非透明模式启动,对于未开启AERO效果的win7系统可加此参数启动以确保界面正常显示
|
||||
|
||||
### 常见问题
|
||||
|
||||
常见问题已移至:<https://github.com/lyswhut/lx-music-desktop/blob/master/FAQ.md>
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
- 新增多语言设置,目前软件内置了简体中文、繁体中文、英语三种语言,欢迎提交PR翻译更多语言!
|
||||
- 新增无法打开外部歌单FAQ
|
||||
- 新增启动参数`search`,使用例子:`.\lx-music-desktop.exe -search="突然的自我 - 伍佰"`
|
||||
|
||||
### 优化
|
||||
|
||||
- 优化月里嫦娥皮肤侧栏鼠标悬浮颜色
|
||||
- 优化播放进度条的动画效果
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
module.exports = mainWindow => {
|
||||
mainWindow.on('close', () => {
|
||||
mainWindow.setProgressBar(-1)
|
||||
})
|
||||
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow = global.mainWindow = null
|
||||
})
|
||||
|
||||
mainWindow.on('restore', () => {
|
||||
mainWindow.webContents.send('restore')
|
||||
})
|
||||
}
|
|
@ -26,6 +26,7 @@ global.envParams = parseEnv()
|
|||
|
||||
require('../common/error')
|
||||
require('./events')
|
||||
const winEvent = require('./events/winEvent')
|
||||
const autoUpdate = require('./utils/autoUpdate')
|
||||
const { isLinux, isMac } = require('../common/utils')
|
||||
|
||||
|
@ -67,13 +68,7 @@ function createWindow() {
|
|||
|
||||
mainWindow.loadURL(winURL)
|
||||
|
||||
mainWindow.on('close', () => {
|
||||
mainWindow.setProgressBar(-1)
|
||||
})
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow = global.mainWindow = null
|
||||
})
|
||||
|
||||
winEvent(mainWindow)
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
if (!isDev) {
|
||||
|
|
|
@ -112,18 +112,8 @@ export default {
|
|||
...mapMutations('download', ['updateDownloadList']),
|
||||
...mapMutations(['setSetting']),
|
||||
init() {
|
||||
rendererInvoke('getEnvParams').then(envParams => {
|
||||
this.envParams = envParams
|
||||
this.isNt = isLinux || this.envParams.nt
|
||||
if (this.isNt) {
|
||||
document.body.classList.remove('transparent')
|
||||
document.body.classList.add('noTransparent')
|
||||
}
|
||||
if (this.isProd && !this.isNt) {
|
||||
document.body.addEventListener('mouseenter', this.dieableIgnoreMouseEvents)
|
||||
document.body.addEventListener('mouseleave', this.enableIgnoreMouseEvents)
|
||||
}
|
||||
})
|
||||
rendererInvoke('getEnvParams').then(this.handleEnvParamsInit)
|
||||
|
||||
document.body.addEventListener('click', this.handleBodyClick, true)
|
||||
rendererOn('update-available', (e, info) => {
|
||||
// this.showUpdateModal(true)
|
||||
|
@ -259,6 +249,27 @@ export default {
|
|||
event.preventDefault()
|
||||
if (/^https?:\/\//.test(event.target.href)) openUrl(event.target.href)
|
||||
},
|
||||
handleEnvParamsInit(envParams) {
|
||||
this.envParams = envParams
|
||||
this.isNt = isLinux || this.envParams.nt
|
||||
if (this.isNt) {
|
||||
document.body.classList.remove('transparent')
|
||||
document.body.classList.add('noTransparent')
|
||||
}
|
||||
if (this.isProd && !this.isNt) {
|
||||
document.body.addEventListener('mouseenter', this.dieableIgnoreMouseEvents)
|
||||
document.body.addEventListener('mouseleave', this.enableIgnoreMouseEvents)
|
||||
}
|
||||
|
||||
if (this.envParams.search != null) {
|
||||
this.$router.push({
|
||||
path: 'search',
|
||||
query: {
|
||||
text: this.envParams.search,
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.clearUpdateTimeout()
|
||||
|
|
|
@ -48,7 +48,7 @@ div(:class="$style.player")
|
|||
|
||||
<script>
|
||||
import Lyric from 'lrc-file-parser'
|
||||
import { rendererSend } from '../../../common/ipc'
|
||||
import { rendererSend, rendererOn } from '../../../common/ipc'
|
||||
import { formatPlayTime2, getRandom, checkPath, setTitle, clipboardWriteText, debounce } from '../../utils'
|
||||
import { mapGetters, mapActions, mapMutations } from 'vuex'
|
||||
import { requestMsg } from '../../utils/message'
|
||||
|
@ -128,6 +128,9 @@ export default {
|
|||
this.setVolume(volume)
|
||||
}, 300)
|
||||
|
||||
rendererOn('restore', () => {
|
||||
this.handleSetTransition()
|
||||
})
|
||||
document.addEventListener('mousemove', this.handleVolumeMsMove)
|
||||
document.addEventListener('mouseup', this.handleVolumeMsUp)
|
||||
window.addEventListener('resize', this.handleResize)
|
||||
|
@ -179,6 +182,9 @@ export default {
|
|||
volume(n) {
|
||||
this.handleSaveVolume(n)
|
||||
},
|
||||
nowPlayTime(n, o) {
|
||||
if (Math.abs(n - o) > 1) this.handleSetTransition()
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
...mapActions('player', ['getUrl', 'getPic', 'getLrc']),
|
||||
|
@ -390,7 +396,7 @@ export default {
|
|||
},
|
||||
setProgess(e) {
|
||||
if (!this.audio.src) return
|
||||
this.isActiveTransition = true
|
||||
// this.isActiveTransition = true
|
||||
this.$nextTick(() => {
|
||||
const time = (e.offsetX / this.pregessWidth) * this.maxPlayTime
|
||||
if (this.audioErrorTime) this.audioErrorTime = time
|
||||
|
@ -583,6 +589,10 @@ export default {
|
|||
this.setMediaDeviceId(null)
|
||||
})
|
||||
},
|
||||
handleSetTransition() {
|
||||
this.isActiveTransition = true
|
||||
// console.log('active transition')
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue