mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2024-11-22 13:36:20 +08:00
fix(electron): set appearance during init of electron window (#525)
resolve #512
This commit is contained in:
parent
1e7274e97f
commit
43a293da6a
|
@ -6,6 +6,7 @@ import {
|
|||
shell,
|
||||
dialog,
|
||||
globalShortcut,
|
||||
nativeTheme,
|
||||
} from "electron";
|
||||
import { createProtocol } from "vue-cli-plugin-electron-builder/lib";
|
||||
import { startNeteaseMusicApi } from "./electron/services";
|
||||
|
@ -93,6 +94,8 @@ class Background {
|
|||
createWindow() {
|
||||
console.log("creating app window");
|
||||
|
||||
const appearance = this.store.get("settings.appearance");
|
||||
|
||||
this.window = new BrowserWindow({
|
||||
width: this.store.get("window.width") || 1440,
|
||||
height: this.store.get("window.height") || 840,
|
||||
|
@ -107,6 +110,12 @@ class Background {
|
|||
enableRemoteModule: true,
|
||||
contextIsolation: false,
|
||||
},
|
||||
backgroundColor:
|
||||
((appearance === undefined || appearance === "auto") &&
|
||||
nativeTheme.shouldUseDarkColors) ||
|
||||
appearance === "dark"
|
||||
? "#222"
|
||||
: "#fff",
|
||||
});
|
||||
|
||||
// hide menu bar on Microsoft Windows and Linux
|
||||
|
|
|
@ -8,6 +8,7 @@ export function getSendSettingsPlugin() {
|
|||
ipcRenderer.send("settings", {
|
||||
minimizeToTray: state.settings.minimizeToTray,
|
||||
enableGlobalShortcut: state.settings.enableGlobalShortcut,
|
||||
appearance: state.settings.appearance,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user