feat: custom shortcuts

This commit is contained in:
qier222 2021-06-09 20:39:00 +08:00
parent 78d90f15f5
commit e54c606c6d
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
9 changed files with 439 additions and 56 deletions

View file

@ -366,14 +366,10 @@ class Background {
this.initOSDLyrics();
// init ipcMain
initIpcMain(
this.window,
{
resizeOSDLyrics: height => this.resizeOSDLyrics(height),
toggleOSDLyrics: () => this.toggleOSDLyrics(),
},
this.store
);
initIpcMain(this.window, this.store, {
resizeOSDLyrics: height => this.resizeOSDLyrics(height),
toggleOSDLyrics: () => this.toggleOSDLyrics(),
});
// set proxy
const proxyRules = this.store.get('proxy');
@ -387,13 +383,7 @@ class Background {
this.checkForUpdates();
// create menu
createMenu(this.window, {
openDevTools: () => {
if (this.osdlyrics) {
this.osdlyrics.webContents.openDevTools();
}
},
});
createMenu(this.window, this.store);
// create tray
if (
@ -411,7 +401,7 @@ class Background {
// register global shortcuts
if (this.store.get('settings.enableGlobalShortcut')) {
registerGlobalShortcut(this.window);
registerGlobalShortcut(this.window, this.store);
}
});