mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-18 06:07:48 +00:00
feat(electron): add minimize to tray option to settings page
This commit is contained in:
parent
09c54486cc
commit
de7d008c0b
8 changed files with 67 additions and 13 deletions
|
|
@ -125,6 +125,22 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" v-if="isElectron && !isMac">
|
||||
<div class="left">
|
||||
<div class="title">最小化到托盘</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="toggle">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="minimize-to-tray"
|
||||
id="minimize-to-tray"
|
||||
v-model="minimizeToTray"
|
||||
/>
|
||||
<label for="minimize-to-tray"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="left">
|
||||
<div class="title"> {{ $t("settings.showGitHubIcon") }} </div>
|
||||
|
|
@ -215,6 +231,12 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
...mapState(["settings", "data"]),
|
||||
isElectron() {
|
||||
return process.env.IS_ELECTRON;
|
||||
},
|
||||
isMac() {
|
||||
return /macintosh|mac os x/i.test(navigator.userAgent);
|
||||
},
|
||||
lang: {
|
||||
get() {
|
||||
return this.settings.lang;
|
||||
|
|
@ -321,6 +343,17 @@ export default {
|
|||
});
|
||||
},
|
||||
},
|
||||
minimizeToTray: {
|
||||
get() {
|
||||
return this.settings.minimizeToTray;
|
||||
},
|
||||
set(value) {
|
||||
this.$store.commit("updateSettings", {
|
||||
key: "minimizeToTray",
|
||||
value,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
logout() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue