setting positioning from the client deciding and the view router deciding

This commit is contained in:
talksik
2022-05-02 08:44:47 -05:00
parent 04f432682e
commit 226b55795c
3 changed files with 38 additions and 7 deletions
+15 -1
View File
@@ -1,5 +1,6 @@
import {
BrowserWindow,
Display,
Menu,
app,
dialog,
@@ -30,7 +31,7 @@ if (require("electron-squirrel-startup")) {
// be closed automatically when the JavaScript object is garbage collected.
export let browserWindow: BrowserWindow;
let display;
let display: Display;
const createWindow = (): void => {
// Create the browser window.
@@ -108,6 +109,19 @@ app
true
);
}
if (req.setPosition) {
if (req.setPosition === "center") {
browserWindow.center();
}
if (req.setPosition === "topRight") {
browserWindow.setPosition(
display.bounds.width - req.dimensions.width,
0
);
}
}
});
})
.then(() => {