docs: Orgnize the options of BrowserWindow

This commit is contained in:
Cheng Zhao 2016-01-07 14:23:21 +08:00
parent 3f2b26ddb7
commit c0e728ab6a

View file

@ -31,8 +31,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
### `new BrowserWindow([options])`
`options` Object (optional), properties:
* `options` Object
* `width` Integer - Window's width in pixels. Default is `800`.
* `height` Integer - Window's height in pixels. Default is `600`.
* `x` Integer - Window's left offset from screen. Default is to center the
@ -78,20 +77,29 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
some GTK+3 desktop environments. Default is `false`.
* `transparent` Boolean - Makes the window [transparent](frameless-window.md).
Default is `false`.
* `type` String - Specifies the type of the window, which applies
additional platform-specific properties. By default it's undefined and you'll
get a regular app window. Supported values:
* `type` String - The type of window, default is normal window. See more about
this bellow.
* `titleBarStyle` String - The style of window title bar. See more about this
bellow.
* `webPreferences` Object - Settings of web page's features. See more about
this bellow.
The possible values and behaviors of `type` option are platform dependent,
supported values are:
* On Linux, possible types are `desktop`, `dock`, `toolbar`, `splash`,
`notification`.
* On OS X, possible types are `desktop`, `textured`. The `textured` type adds
metal gradient appearance (`NSTexturedBackgroundWindowMask`). The `desktop`
type places the window at the desktop background window level
* On OS X, possible types are `desktop`, `textured`.
* The `textured` type adds metal gradient appearance
(`NSTexturedBackgroundWindowMask`).
* The `desktop` type places the window at the desktop background window level
(`kCGDesktopWindowLevel - 1`). Note that desktop window will not receive
focus, keyboard or mouse events, but you can use `globalShortcut` to receive
input sparingly.
* `titleBarStyle` 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:
The `titleBarStyle` option is only supported on OS X 10.10 Yosemite and newer.
Possible values are:
* `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
@ -99,7 +107,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
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.
* `webPreferences` Object - Settings of web page's features, properties:
The `webPreferences` option is an object that can have following properties:
* `nodeIntegration` Boolean - Whether node integration is enabled. Default
is `true`.
* `preload` String - Specifies a script that will be loaded before other