mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-14 03:41:46 +00:00
Remember window position
This commit is contained in:
5
index.js
5
index.js
@ -67,6 +67,7 @@ function loadPlugins(win) {
|
||||
function createMainWindow() {
|
||||
const windowSize = config.get("window-size");
|
||||
const windowMaximized = config.get("window-maximized");
|
||||
const windowPosition = config.get("window-position");
|
||||
|
||||
const win = new electron.BrowserWindow({
|
||||
icon: icon,
|
||||
@ -95,6 +96,10 @@ function createMainWindow() {
|
||||
titleBarStyle: is.macOS() ? "hiddenInset" : "default",
|
||||
autoHideMenuBar: config.get("options.hideMenu"),
|
||||
});
|
||||
if (windowPosition) {
|
||||
const { x, y } = windowPosition;
|
||||
win.setPosition(x, y);
|
||||
}
|
||||
if (windowMaximized) {
|
||||
win.maximize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user