diff --git a/publish/changeLog.md b/publish/changeLog.md
index 6cc5c85b..db6fe907 100644
--- a/publish/changeLog.md
+++ b/publish/changeLog.md
@@ -8,6 +8,7 @@
- 新增我的列表右键菜单复制歌曲名选项
- 新增桌面歌词,默认关闭,可到设置或者托盘菜单开启;调整字体大小、透明度时,鼠标左击按钮正常调整,右击微调;已知windows下贴边拖拽调整歌词窗口大小时可能会导致窗口变黑,这时只需将窗口拖屏幕离边缘再拖回去即可;Windows 7未开启Aero效果时桌面歌词会有问题,详情看常见问题解决;Linux版桌面歌词有问题,以后再尝试优化;
- 新增“清热板蓝”皮肤
+- 新增软件最小化、关闭按钮位置设置,MAC版默认为左边,非MAC为右边,不想用默认的可到设置修改
### 优化
diff --git a/src/common/defaultSetting.js b/src/common/defaultSetting.js
index 39c30b6d..b01e446e 100644
--- a/src/common/defaultSetting.js
+++ b/src/common/defaultSetting.js
@@ -1,8 +1,9 @@
const path = require('path')
const os = require('os')
+const { isMac } = require('./utils')
const defaultSetting = {
- version: '1.0.29',
+ version: '1.0.30',
player: {
togglePlayMethod: 'listLoop',
highQuality: false,
@@ -19,7 +20,7 @@ const defaultSetting = {
height: 700,
x: -1,
y: -1,
- theme: 'green',
+ theme: 0,
style: {
fontSize: 125,
opacity: 80,
@@ -84,6 +85,7 @@ const defaultSetting = {
randomAnimate: true,
ignoreVersion: null,
isAgreePact: false,
+ controlBtnPosition: isMac ? 'left' : 'right',
}
const overwriteSetting = {
diff --git a/src/common/utils.js b/src/common/utils.js
index 1591db88..7c4e238b 100644
--- a/src/common/utils.js
+++ b/src/common/utils.js
@@ -164,6 +164,7 @@ exports.initSetting = () => {
// 重置 ^0.18.2 排行榜ID
if (!newSetting.leaderboard.tabId.includes('__')) newSetting.leaderboard.tabId = 'kw__16'
+ // newSetting.controlBtnPosition = 'right'
electronStore_config.set('version', settingVersion)
electronStore_config.set('setting', newSetting)
return newSetting
diff --git a/src/renderer/App.vue b/src/renderer/App.vue
index aa58533b..2357be0d 100644
--- a/src/renderer/App.vue
+++ b/src/renderer/App.vue
@@ -28,6 +28,8 @@ import { rendererOn, rendererSend, rendererInvoke, NAMES } from '../common/ipc'
import { isLinux } from '../common/utils'
import music from './utils/music'
import { throttle, openUrl } from './utils'
+import { base as eventBaseName } from './event/names'
+
window.ELECTRON_DISABLE_SECURITY_WARNINGS = process.env.ELECTRON_DISABLE_SECURITY_WARNINGS
dnscache({
enable: true,
@@ -92,7 +94,7 @@ export default {
},
mounted() {
document.body.classList.add(this.isNt ? 'noTransparent' : 'transparent')
- window.eventHub.$emit('bindKey')
+ window.eventHub.$emit(eventBaseName.bindKey)
this.init()
},
watch: {
@@ -202,7 +204,7 @@ export default {
// this.setDesktopLyricConfig(config)
// console.log('set_config', JSON.stringify(this.setting) === JSON.stringify(config))
this.setSetting(Object.assign({}, this.setting, config))
- window.eventHub.$emit('set_config', config)
+ window.eventHub.$emit(eventBaseName.set_config, config)
})
// 更新超时定时器
this.updateTimeout = setTimeout(() => {
@@ -346,7 +348,7 @@ export default {
document.body.removeEventListener('mouseleave', this.enableIgnoreMouseEvents)
}
document.body.removeEventListener('click', this.handleBodyClick)
- window.eventHub.$emit('unbindKey')
+ window.eventHub.$emit(eventBaseName.unbindKey)
},
}
diff --git a/src/renderer/assets/styles/variables.less b/src/renderer/assets/styles/variables.less
index 1e2a3f56..761b7aab 100644
--- a/src/renderer/assets/styles/variables.less
+++ b/src/renderer/assets/styles/variables.less
@@ -638,7 +638,7 @@
@color-blue2-closeBtn-hover: fadeout(@color-blue2-closeBtn, 10%);
@color-blue2-badge-success: lighten(@color-blue2-theme, 15%);
@color-blue2-badge-success-font: #fff;
-@color-blue2-badge-info: #6376a2;
+@color-blue2-badge-info: #b080db;
@color-blue2-badge-info-font: #fff;
diff --git a/src/renderer/components/core/Aside.vue b/src/renderer/components/core/Aside.vue
index 56132281..14b46ec0 100644
--- a/src/renderer/components/core/Aside.vue
+++ b/src/renderer/components/core/Aside.vue
@@ -1,6 +1,14 @@
div(:class="$style.aside")
- div(:class="['animated', logoAnimate, $style.logo]") L X
+ div(:class="$style.controlBtn" v-if="setting.controlBtnPosition == 'left'")
+ button(type="button" :class="$style.close" :title="$t('core.toolbar.close')" @click="close")
+ svg(:class="$style.controlBtniIcon" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' width='100%' viewBox='0 0 24 24' space='preserve')
+ use(xlink:href='#icon-window-close')
+ button(type="button" :class="$style.min" :title="$t('core.toolbar.min')" @click="min")
+ svg(:class="$style.controlBtniIcon" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' width='100%' viewBox='0 0 24 24' space='preserve')
+ use(xlink:href='#icon-window-minimize')
+
+ div(:class="['animated', logoAnimate, $style.logo]" v-else) L X
//- svg(version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' width='100%' height='100%' viewBox='0 0 127 61' space='preserve')
use(xlink:href='#icon-logo')
@@ -49,6 +57,7 @@ div(:class="$style.aside")
@@ -102,11 +120,58 @@ export default {
display: flex;
flex-flow: column nowrap;
}
-:global(.nd) {
- .aside {
- -webkit-app-region: no-drag;
+
+@control-btn-width: @height-toolbar * .26;
+@control-btn-height: 6%;
+.controlBtn {
+ box-sizing: border-box;
+ padding: 0 7px;
+ display: flex;
+ align-items: center;
+ justify-content: space-evenly;
+ width: 100%;
+ height: @control-btn-height;
+ -webkit-app-region: no-drag;
+ opacity: .5;
+ transition: opacity @transition-theme;
+ &:hover {
+ opacity: .8;
+ .controlBtniIcon {
+ opacity: 1;
+ }
+ }
+
+ button {
+ position: relative;
+ width: @control-btn-width;
+ height: @control-btn-width;
+ background: none;
+ border: none;
+ // display: flex;
+ // justify-content: center;
+ // align-items: center;
+ outline: none;
+ padding: 1px;
+ cursor: pointer;
+ border-radius: 50%;
+ color: #fff;
+
+ &.min {
+ background-color: @color-minBtn;
+ }
+ &.max {
+ background-color: @color-maxBtn;
+ }
+ &.close {
+ background-color: @color-closeBtn;
+ }
}
}
+.controlBtniIcon {
+ opacity: 0;
+ transition: opacity 0.2s ease-in-out;
+}
+
.logo {
box-sizing: border-box;
padding: 0 13%;
@@ -115,15 +180,18 @@ export default {
flex: none;
text-align: center;
line-height: 50px;
+ font-weight: bold;
// -webkit-app-region: no-drag;
}
.menu {
flex: auto;
- // display: flex;
- // flex-flow: column nowrap;
- // justify-content: center;
- // padding-bottom: 50px;
+ // &.controlBtnLeft {
+ // display: flex;
+ // flex-flow: column nowrap;
+ // justify-content: center;
+ // padding-bottom: @control-btn-height;
+ // }
// padding: 5px;
dl {
-webkit-app-region: no-drag;
@@ -187,6 +255,19 @@ each(@themes, {
.aside {
background-color: ~'@{color-@{value}-theme-sidebar}';
}
+ .controlBtn {
+ button {
+ &.min {
+ background-color: ~'@{color-@{value}-minBtn}';
+ }
+ &.max {
+ background-color: ~'@{color-@{value}-maxBtn}';
+ }
+ &.close {
+ background-color: ~'@{color-@{value}-closeBtn}';
+ }
+ }
+ }
.logo {
color: ~'@{color-@{value}-theme-font}';
}
diff --git a/src/renderer/components/core/Icons.vue b/src/renderer/components/core/Icons.vue
index fba48163..ae88bd37 100644
--- a/src/renderer/components/core/Icons.vue
+++ b/src/renderer/components/core/Icons.vue
@@ -124,5 +124,17 @@ svg(version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/19
g#icon-list-add(fill='currentColor')
//- 0 0 24 24
path(d='M2,16H10V14H2M18,14V10H16V14H12V16H16V20H18V16H22V14M14,6H2V8H14M14,10H2V12H14V10Z')
+
+ g#icon-window-hide(fill='currentColor')
+ //- 0 0 30.727 30.727
+ path(d="M29.994,10.183L15.363,24.812L0.733,10.184c-0.977-0.978-0.977-2.561,0-3.536c0.977-0.977,2.559-0.976,3.536,0l11.095,11.093L26.461,6.647c0.977-0.976,2.559-0.976,3.535,0C30.971,7.624,30.971,9.206,29.994,10.183z")
+
+ g#icon-window-minimize(fill='currentColor')
+ //- 0 0 24 24
+ path(d="M20,14H4V10H20")
+
+ g#icon-window-close(fill='currentColor')
+ //- 0 0 24 24
+ path(d="M20 6.91L17.09 4L12 9.09L6.91 4L4 6.91L9.09 12L4 17.09L6.91 20L12 14.91L17.09 20L20 17.09L14.91 12L20 6.91Z")
diff --git a/src/renderer/components/core/PlayerDetail.vue b/src/renderer/components/core/PlayerDetail.vue
index 98109e78..66e680eb 100644
--- a/src/renderer/components/core/PlayerDetail.vue
+++ b/src/renderer/components/core/PlayerDetail.vue
@@ -1,13 +1,20 @@
- div(:class="$style.container" @contextmenu="handleContextMenu")
+ div(:class="[$style.container, setting.controlBtnPosition == 'left' ? $style.controlBtnLeft : $style.controlBtnRight]" @contextmenu="handleContextMenu")
//- div(:class="$style.bg" :style="bgStyle")
//- div(:class="$style.bg2")
div(:class="$style.header")
- div(:class="$style.control")
+ div(:class="$style.controBtn")
button(type="button" :class="$style.hide" :title="$t('core.player.hide_detail')" @click="visiblePlayerDetail(false)")
+ svg(:class="$style.controBtnIcon" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' width='80%' viewBox='0 0 30.727 30.727' space='preserve')
+ use(xlink:href='#icon-window-hide')
button(type="button" :class="$style.min" :title="$t('core.toolbar.min')" @click="min")
+ svg(:class="$style.controBtnIcon" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' width='100%' viewBox='0 0 24 24' space='preserve')
+ use(xlink:href='#icon-window-minimize')
+
//- button(type="button" :class="$style.max" @click="max")
button(type="button" :class="$style.close" :title="$t('core.toolbar.close')" @click="close")
+ svg(:class="$style.controBtnIcon" version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' width='100%' viewBox='0 0 24 24' space='preserve')
+ use(xlink:href='#icon-window-close')
div(:class="$style.main")
div(:class="$style.left")
@@ -59,7 +66,7 @@