MenuItemConstructorOptions

Properties

Link copied to clipboard
abstract var accelerator: Accelerator?
Link copied to clipboard

default is true, and when false will prevent the accelerator from triggering the item if the item is not visible.

Link copied to clipboard
abstract var after: ReadonlyArray<String>?

Inserts this item after the item with the specified label. If the referenced item doesn't exist the item will be inserted at the end of the menu.

Link copied to clipboard

Provides a means for a single context menu to declare the placement of their containing group after the containing group of the item with the specified label.

Link copied to clipboard
abstract var before: ReadonlyArray<String>?

Inserts this item before the item with the specified label. If the referenced item doesn't exist the item will be inserted at the end of the menu. Also implies that the menu item in question should be placed in the same “group” as the item.

Link copied to clipboard

Provides a means for a single context menu to declare the placement of their containing group before the containing group of the item with the specified label.

Link copied to clipboard
abstract var checked: Boolean?

Should only be specified for checkbox or radio type menu items.

Link copied to clipboard
abstract var click: (menuItem: MenuItem, browserWindow: BrowserWindow?, event: KeyboardEvent) -> Unit?

Will be called with click(menuItem, browserWindow, event) when the menu item is clicked.

Link copied to clipboard
abstract var enabled: Boolean?

If false, the menu item will be greyed out and unclickable.

Link copied to clipboard
abstract var icon: Any?
Link copied to clipboard
abstract var id: String?

Unique within a single menu. If defined then it can be used as a reference to this item by the position attribute.

Link copied to clipboard
abstract var label: String?
Link copied to clipboard

If false, the accelerator won't be registered with the system, but it will still be displayed. Defaults to true.

Link copied to clipboard

Can be undo, redo, cut, copy, paste, pasteAndMatchStyle, delete, selectAll, reload, forceReload, toggleDevTools, resetZoom, zoomIn, zoomOut, toggleSpellChecker, togglefullscreen, window, minimize, close, help, about, services, hide, hideOthers, unhide, quit, showSubstitutions, toggleSmartQuotes, toggleSmartDashes, toggleTextReplacement, startSpeaking, stopSpeaking, zoom, front, appMenu, fileMenu, editMenu, viewMenu, shareMenu, recentDocuments, toggleTabBar, selectNextTab, selectPreviousTab, showAllTabs, mergeAllWindows, clearRecentDocuments, moveTabToNewWindow or windowMenu

Link copied to clipboard
abstract var sharingItem: SharingItem?

The item to share when the role is shareMenu.

Link copied to clipboard
abstract var sublabel: String?
Link copied to clipboard
abstract var submenu: Any?

Should be specified for submenu type menu items. If submenu is specified, the type: 'submenu' can be omitted. If the value is not a Menu then it will be automatically converted to one using Menu.buildFromTemplate.

Link copied to clipboard
abstract var toolTip: String?

Hover text for this menu item.

Link copied to clipboard

Can be normal, separator, submenu, checkbox or radio.

Link copied to clipboard
abstract var visible: Boolean?

If false, the menu item will be entirely hidden.