Created
November 15, 2018 12:47
-
-
Save amorist/26b1f370a98641808ce902c8ec949e63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getWindowPosition = () => { | |
const windowBounds = window.getBounds() | |
const trayBounds = tray.getBounds() | |
// Center window horizontally below the tray icon | |
const x = Math.round(trayBounds.x + (trayBounds.width / 2) - (windowBounds.width / 2)) | |
// Position window 4 pixels vertically below the tray icon | |
const y = Math.round(trayBounds.y + trayBounds.height + 4) | |
return {x: x, y: y} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment