feat: add global shortcut setting (#470)

* feat: add global short cut setting

* fix: fix settings not work

* fix: call initIpcMan after createWindow

* fix: fix build error (typo)
This commit is contained in:
wenjie 2021-03-25 21:20:53 +08:00 committed by GitHub
parent b98bf909fb
commit 36447ae5d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 50 additions and 7 deletions

View file

@ -271,6 +271,22 @@
</div>
</div>
</div>
<div class="item" v-if="isElectron">
<div class="left">
<div class="title"> {{ $t("settings.enableGlobalShortcut") }}</div>
</div>
<div class="right">
<div class="toggle">
<input
type="checkbox"
name="enable-enable-global-shortcut"
id="enable-enable-global-shortcut"
v-model="enableGlobalShortcut"
/>
<label for="enable-enable-global-shortcut"></label>
</div>
</div>
</div>
<div class="item">
<div class="left">
<div class="title" style="transform: scaleX(-1)">🐈 🏳🌈</div>
@ -491,8 +507,19 @@ export default {
});
},
},
isLastfmConnected() {
return this.lastfm.key !== undefined;
enableGlobalShortcut: {
get() {
return this.settings.enableGlobalShortcut;
},
set(value) {
this.$store.commit("updateSettings", {
key: "enableGlobalShortcut",
value,
});
},
isLastfmConnected() {
return this.lastfm.key !== undefined;
},
},
},
methods: {