docs: Orgnize the options of BrowserWindow

This commit is contained in:
Cheng Zhao 2016-01-07 14:23:21 +08:00
Родитель 3f2b26ddb7
Коммит c0e728ab6a
1 изменённых файлов: 113 добавлений и 103 удалений

Просмотреть файл

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