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:
Daniel Ma 2017-06-11 01:19:01 -07:00
parent a6ea316a5d
commit 4fb9f825b1
14 changed files with 61 additions and 1 deletions

View file

@ -7,6 +7,7 @@
#include <Quartz/Quartz.h>
#include <string>
#include "atom/browser/browser.h"
#include "atom/browser/native_browser_view_mac.h"
#include "atom/browser/ui/cocoa/atom_touch_bar.h"
#include "atom/browser/window_list.h"
@ -417,6 +418,11 @@ bool ScopedDisableResize::disable_resize_ = false;
shell_->NotifyWindowSheetEnd();
}
- (IBAction)newWindowForTab:(id)sender {
shell_->NotifyNewWindowForTab();
atom::Browser::Get()->NewWindowForTab();
}
@end
@interface AtomPreviewItem : NSObject <QLPreviewItem>