menubar
- Version 9.5.1
- Published
- 720 kB
- 1 dependency
- BSD-2-Clause license
Install
npm i menubar
yarn add menubar
pnpm add menubar
Overview
high level way to create menubar desktop applications with electron
Index
Functions
function getWindowPosition
getWindowPosition: (tray: Tray) => WindowPosition;
Depending on where the taskbar is, determine where the window should be positioned.
Parameter tray
The Electron Tray instance.
function menubar
menubar: (options?: Partial<Options>) => Menubar;
Factory function to create a menubar application
Parameter options
Options for creating a menubar application, see Options
function taskbarLocation
taskbarLocation: (tray: Tray) => TaskbarLocation;
Determine taskbard location: "top", "bottom", "left" or "right".
Only tested on Windows for now, and only used in Windows.
Parameter tray
The Electron Tray instance.
Classes
class Menubar
class Menubar extends EventEmitter {}
The main Menubar class.
constructor
constructor(app: Electron.App, options?: Partial<Options>);
property app
readonly app: Electron.App;
The Electron [App](https://electronjs.org/docs/api/app) instance.
property positioner
readonly positioner: Positioner;
The [electron-positioner](https://github.com/jenslind/electron-positioner) instance.
property tray
readonly tray: Tray;
The Electron [Tray](https://electronjs.org/docs/api/tray) instance.
property window
readonly window: any;
The Electron [BrowserWindow](https://electronjs.org/docs/api/browser-window) instance, if it's present.
method getOption
getOption: <K extends keyof Options>(key: K) => Options[K];
Retrieve a menubar option.
Parameter key
The option key to retrieve, see Options.
method hideWindow
hideWindow: () => void;
Hide the menubar window.
method setOption
setOption: <K extends keyof Options>(key: K, value: Options[K]) => void;
Change an option after menubar is created.
Parameter key
The option key to modify, see Options.
Parameter value
The value to set.
method showWindow
showWindow: (trayPos?: Electron.Rectangle) => Promise<void>;
Show the menubar window.
Parameter trayPos
The bounds to show the window in.
Package Files (3)
Dependencies (1)
Dev Dependencies (11)
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/menubar
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/menubar)
- HTML<a href="https://www.jsdocs.io/package/menubar"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1800 ms. - Missing or incorrect documentation? Open an issue for this package.