Guest User

Untitled

a guest
Nov 15th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. const getWindowPosition = () => {
  2. const windowBounds = window.getBounds()
  3. const trayBounds = tray.getBounds()
  4.  
  5. // Center window horizontally below the tray icon
  6. const x = Math.round(trayBounds.x + (trayBounds.width / 2) - (windowBounds.width / 2))
  7.  
  8. // Position window 4 pixels vertically below the tray icon
  9. const y = Math.round(trayBounds.y + trayBounds.height + 4)
  10.  
  11. return {x: x, y: y}
  12. }
Add Comment
Please, Sign In to add comment