feat: make trafficLightPosition work for customButtonOnHover (#26789)

This commit is contained in:
Cheng Zhao 2020-12-16 14:30:39 +09:00 committed by GitHub
parent 1e2a2004e9
commit e01b1831d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 76 additions and 45 deletions

View file

@ -227,7 +227,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
unless hovered over in the top left of the window. These custom buttons prevent
issues with mouse events that occur with the standard window toolbar buttons.
**Note:** This option is currently experimental.
* `trafficLightPosition` [Point](structures/point.md) (optional) - Set a custom position for the traffic light buttons. Can only be used with `titleBarStyle` set to `hidden`
* `trafficLightPosition` [Point](structures/point.md) (optional) - Set a
custom position for the traffic light buttons. Can only be used with
`titleBarStyle` set to `hidden` or `customButtonsOnHover`.
* `fullscreenWindowTitle` Boolean (optional) - Shows the title in the
title bar in full screen mode on macOS for all `titleBarStyle` options.
Default is `false`.
@ -1737,12 +1739,13 @@ deprecated and will be removed in an upcoming version of macOS.
* `position` [Point](structures/point.md)
Set a custom position for the traffic light buttons. Can only be used with `titleBarStyle` set to `hidden`.
Set a custom position for the traffic light buttons. Can only be used with
`titleBarStyle` set to `hidden` or `customButtonsOnHover`.
#### `win.getTrafficLightPosition()` _macOS_
Returns `Point` - The current position for the traffic light buttons. Can only be used with `titleBarStyle`
set to `hidden`.
Returns `Point` - The current position for the traffic light buttons. Can only
be used with `titleBarStyle` set to `hidden` or `customButtonsOnHover`.
#### `win.setTouchBar(touchBar)` _macOS_