feat: allow windows to be excluded from the windows menu (#17404)
* feat: allow windows to be excluded from the windows menu * excludedfromWindowsMenu => excludedFromShownWindowsMenu * implement no-op for win & linux
This commit is contained in:
parent
ec5e0ef06e
commit
4e57a732a8
8 changed files with 57 additions and 0 deletions
|
@ -1648,3 +1648,24 @@ removed in future Electron releases.
|
|||
[vibrancy-docs]: https://developer.apple.com/documentation/appkit/nsvisualeffectview?preferredLanguage=objc
|
||||
[window-levels]: https://developer.apple.com/documentation/appkit/nswindow/level
|
||||
[chrome-content-scripts]: https://developer.chrome.com/extensions/content_scripts#execution-environment
|
||||
|
||||
### Properties
|
||||
|
||||
#### `win.excludedFromShownWindowsMenu` _macOS_
|
||||
|
||||
A `Boolean` property that determines whether the window is excluded from the application’s Windows menu. `false` by default.
|
||||
|
||||
```js
|
||||
const win = new BrowserWindow({ height: 600, width: 600 })
|
||||
|
||||
const template = [
|
||||
{
|
||||
role: 'windowmenu'
|
||||
}
|
||||
]
|
||||
|
||||
win.excludedFromShownWindowsMenu = true
|
||||
|
||||
const menu = Menu.buildFromTemplate(template)
|
||||
Menu.setApplicationMenu(menu)
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue