更新歌曲播放栏布局

This commit is contained in:
lyswhut
2022-11-03 06:34:57 +08:00
parent 2003c5a0c9
commit 716120ea61
25 changed files with 731 additions and 233 deletions
@@ -1,7 +1,5 @@
import { onMounted, onBeforeUnmount, watch, reactive, ref } from '@common/utils/vueTools'
import { isFullscreen } from '@renderer/store'
let rootOffset = window.dt ? 0 : 8
export default ({ visible, location, onHide }) => {
const transition1 = 'transform, opacity'
@@ -61,13 +59,9 @@ export default ({ visible, location, onHide }) => {
visible ? handleShow() : handleHide()
}, { immediate: true })
watch(isFullscreen, isFullscreen => {
rootOffset = window.dt || isFullscreen ? 0 : 8
}, { immediate: true })
watch(location, location => {
menuStyles.left = location.x - rootOffset + 2 + 'px'
menuStyles.top = location.y - rootOffset + 'px'
menuStyles.left = location.x - window.lx.rootOffset + 2 + 'px'
menuStyles.top = location.y - window.lx.rootOffset + 'px'
// nextTick(() => {
if (show) {
if (menuStyles.transitionProperty != transition2) menuStyles.transitionProperty = transition2
@@ -4,13 +4,13 @@ import {
} from '@common/utils/vueTools'
import { useI18n } from '@renderer/plugins/i18n'
const playNextModes = [
'listLoop',
'random',
'list',
'singleLoop',
'none',
] as const
// const playNextModes = [
// 'listLoop',
// 'random',
// 'list',
// 'singleLoop',
// 'none',
// ] as const
export default () => {
const t = useI18n()
@@ -24,10 +24,11 @@ export default () => {
}
})
const toggleNextPlayMode = () => {
let index = playNextModes.indexOf(appSetting['player.togglePlayMethod'])
if (++index >= playNextModes.length) index = 0
setTogglePlayMode(playNextModes[index] ?? playNextModes[0])
const toggleNextPlayMode = (mode: LX.AppSetting['player.togglePlayMethod']) => {
if (mode == appSetting['player.togglePlayMethod']) return
// let index = playNextModes.indexOf(appSetting['player.togglePlayMethod'])
// if (++index >= playNextModes.length) index = 0
setTogglePlayMode(mode)
}
return {