mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Update trayMenus Extension API documentation
Signed-off-by: Juho Heikka <juho.heikka@gmail.com>
This commit is contained in:
parent
85714422af
commit
c3e494fa47
@ -97,7 +97,19 @@ This page would be defined in your extension's `Renderer.LensExtension` implemen
|
|||||||
|
|
||||||
### `trayMenus`
|
### `trayMenus`
|
||||||
|
|
||||||
`trayMenus` is a subset of Electron's [`MenuItemConstructorOptions`](https://www.electronjs.org/docs/v14-x-y/api/menu-item). Most importantly you can define a `label` and a `click` handler. Other properties are `submenu`, `enabled`, `visible`, `toolTip`, `id` and `type`.
|
`trayMenus` is an array of `TrayMenuRegistration` objects. Most importantly you can define a `label` and a `click` handler. Other properties are `submenu`, `enabled`, `toolTip`, `id` and `type`.
|
||||||
|
|
||||||
|
``` typescript
|
||||||
|
interface TrayMenuRegistration {
|
||||||
|
label?: string;
|
||||||
|
click?: (menuItem: TrayMenuRegistration) => void;
|
||||||
|
id?: string;
|
||||||
|
type?: "normal" | "separator" | "submenu"
|
||||||
|
toolTip?: string;
|
||||||
|
enabled?: boolean;
|
||||||
|
submenu?: TrayMenuRegistration[]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
The following example demonstrates how tray menus can be added from extension:
|
The following example demonstrates how tray menus can be added from extension:
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user