README
electron-menubar
This lets you create a menubar very easily with Electron.
Install
npm install --save electron-menubar
Documentation
Class Menubar
new Menubar([options])
optionsObject (optional)iconString. The tray's icon. Defaults toapp.getAppPath()/icon.png.indexString. The index file for the window. Defaults toapp.getAppPath()/index.html.preloadWindowBoolean. Tells if the window must be preloaded. Defaults tofalse.showDockIconBoolean. Default isfalse.showOnRightClickBoolean. Default isfalse.showOnAllWorkspacesBoolean. Default isfalse.tooltipString. The tray's tooltip.
Methods
menubar.isReady()tells if the menubar is already ready.menubar.hide()hides the window.menubar.show()shows the window.
Events
readycreate-windowafter-create-windowhideafter-hideshowafter-show
Class Positioner
Positioner.getTaskbarPosition()returns the position of the taskbar:top|right|bottom|left.Positioner.position(window, trayBounds, [alignment])positions the window in a certain place.windowBrowserWindow. Is the window to position.trayBoundsRectangle. Are the bounds from the Electron.Tray.alignmentObject. Are the positions to position the window.alignment.xString. Defaults tocenter. Can beleft|center|right.alignment.yString. Defaults tocenter. Can beup|center|down.
Positioner.calculate(windowBounds, trayBounds, [alignment])only calculates the position and returns an Object{x: n, y: k}.windowBoundsRectangle. A BrowserWindow bounds.trayBoundsRectangle. Are the bounds from the Electron.Tray.alignmentObject. Are the positions to position the window.alignment.xString. Defaults tocenter. Can beleft|center|right.alignment.yString. Defaults tocenter. Can beup|center|down.
Credits
The code of this project is mainly based on menubar and electron-traywindow-positioner with some improvements and cleaning.