1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 14:07:01 +09:00

JS-3089: fixes

This commit is contained in:
Andrew Simachev 2023-10-12 14:02:53 +02:00
parent 007f289e1b
commit 6e475c558e
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
6 changed files with 29 additions and 10 deletions

View file

@ -203,16 +203,11 @@ class WindowManager {
};
};
updateTheme () {
this.list.forEach(it => {
Util.send(it, 'native-theme', Util.isDarkTheme());
});
};
getWindowPosition (param, displayWidth, displayHeight) {
const currentWindow = BrowserWindow.getFocusedWindow();
let x = Math.round(displayWidth / 2 - param.width / 2);
let y = Math.round(displayHeight / 2 - param.height / 2 + 20);
const currentWindow = BrowserWindow.getFocusedWindow();
if (currentWindow) {
const [xPos, yPos] = currentWindow.getPosition();
@ -232,6 +227,13 @@ class WindowManager {
return { x, y };
};
sendToAll () {
const args = [ ...arguments ];
this.list.forEach(it => {
Util.send.apply(this, [ it ].concat(args));
});
};
};
module.exports = new WindowManager();