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:
parent
007f289e1b
commit
6e475c558e
6 changed files with 29 additions and 10 deletions
|
@ -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();
|
Loading…
Add table
Add a link
Reference in a new issue