Implements #2734 “New API to configure BrowserWindow title bar on Mac”

New API supported on Yosemite 10.10 and newer.
This commit is contained in:
jaanus 2015-09-14 14:15:41 +02:00
parent 9e7b67802c
commit 5d8f1dd404
6 changed files with 70 additions and 0 deletions

View file

@ -70,6 +70,16 @@ Properties `width` and `height` are required.
Linux.
* `standard-window` Boolean - Uses the OS X's standard window instead of the
textured window. Defaults to `true`.
* `title-bar-style` String, OS X - specifies the style of window title bar.
This option is supported on OS X 10.10 Yosemite and newer. There are three
possible values:
* `default` or not specified results in the standard gray opaque Mac title
bar.
* `hidden` results in a hidden title bar and a full size content window, yet
the title bar still has the standard window controls ("traffic lights") in
the top left.
* `hidden-inset` results in a hidden title bar with an alternative look
where the traffic light buttons are slightly more inset from the window edge.
* `web-preferences` Object - Settings of web page's features, properties:
* `node-integration` Boolean - Whether node integration is enabled. Default
is `true`.

View file

@ -13,6 +13,20 @@ var BrowserWindow = require('browser-window');
var win = new BrowserWindow({ width: 800, height: 600, frame: false });
```
### Alternatives on Mac
On Mac OS X 10.10 Yosemite and newer, there's an alternative way to specify
a chromeless window. Instead of setting `frame` to `false` which disables
both the titlebar and window controls, you may want to have the title bar
hidden and your content extend to the full window size, yet still preserve
the window controls ("traffic lights") for standard window actions.
You can do so by specifying the new `title-bar-style` option:
```javascript
var BrowserWindow = require('browser-window');
var win = new BrowserWindow({ width: 800, height: 600, 'title-bar-style': 'hidden' });
```
## Transparent window
By setting the `transparent` option to `true`, you can also make the frameless