Merge pull request #10667 from dittos/window-opacity

Add window opacity support
This commit is contained in:
Cheng Zhao 2017-10-04 15:03:45 +09:00 committed by GitHub
commit 8c5bb5969c
12 changed files with 92 additions and 0 deletions

View file

@ -205,6 +205,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
`#FFF` (white).
* `hasShadow` Boolean (optional) - Whether window should have a shadow. This is only
implemented on macOS. Default is `true`.
* `opacity` Number (optional) - Set the initial opacity of the window, between 0.0 (fully
transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
* `darkTheme` Boolean (optional) - Forces using dark theme for the window, only works on
some GTK+3 desktop environments. Default is `false`.
* `transparent` Boolean (optional) - Makes the window [transparent](frameless-window.md).
@ -1206,6 +1208,16 @@ Returns `Boolean` - Whether the window has a shadow.
On Windows and Linux always returns
`true`.
#### `win.setOpacity(opacity)` _Windows_ _macOS_
* `opacity` Number - between 0.0 (fully transparent) and 1.0 (fully opaque)
Sets the opacity of the window. On Linux does nothing.
#### `win.getOpacity()` _Windows_ _macOS_
Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque)
#### `win.setThumbarButtons(buttons)` _Windows_
* `buttons` [ThumbarButton[]](structures/thumbar-button.md)