Add "New Tab" button for Native macOS Tabs
Adds responders for `newWindowForTab` to `AtomApplicationDelegate` and `NativeWindowMac`, so that `BrowserWindow`s with a `tabbingIdentifier` will get the new tab button, and both `app` and `window` will emit a `new-tab-for-window` event.
This commit is contained in:
parent
a6ea316a5d
commit
4fb9f825b1
14 changed files with 61 additions and 1 deletions
|
@ -149,6 +149,16 @@ ID as the activity's source app and that supports the activity's type.
|
|||
Supported activity types are specified in the app's `Info.plist` under the
|
||||
`NSUserActivityTypes` key.
|
||||
|
||||
### Event: 'new-window-for-tab' _macOS_
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
|
||||
Emitted when the user clicks the native macOS new tab button. The new
|
||||
tab button is only visible if the current `BrowserWindow` has a
|
||||
`tabbingIdentifier`
|
||||
|
||||
### Event: 'browser-window-blur'
|
||||
|
||||
Returns:
|
||||
|
|
|
@ -239,7 +239,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
|||
`maximize()` directly. Default is `false`.
|
||||
* `tabbingIdentifier` String (optional) - Tab group name, allows opening the
|
||||
window as a native tab on macOS 10.12+. Windows with the same tabbing
|
||||
identifier will be grouped together.
|
||||
identifier will be grouped together. This also adds a native new tab button
|
||||
to your window's tab bar and allows your `app` and window to receive the
|
||||
`new-window-for-tab` event.
|
||||
* `webPreferences` Object (optional) - Settings of web page's features.
|
||||
* `devTools` Boolean (optional) - Whether to enable DevTools. If it is set to `false`, can not use `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.
|
||||
* `nodeIntegration` Boolean (optional) - Whether node integration is enabled. Default
|
||||
|
@ -547,6 +549,10 @@ Emitted when the window opens a sheet.
|
|||
|
||||
Emitted when the window has closed a sheet.
|
||||
|
||||
#### Event: 'new-window-for-tab' _macOS_
|
||||
|
||||
Emitted when the native new tab button is clicked.
|
||||
|
||||
### Static Methods
|
||||
|
||||
The `BrowserWindow` class has the following static methods:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue