I am trying to add tabs to a window with no titlebar. Setting self.titlebarAppearsTransparent = true
or disabling the titlebar blocks system tabs, and I can't find any Safari style tabs in the object panel.
On a normal window, you can create tabs by making two windows and selecting Window > Merge All Windows
This can be seen below the default "Show, Minimize, Zoom" that Xcode makes.
On a borderless window, the option is not there and is not in first responder
On a window with a titlebarAppearsTransparent, the option is not there and is not in first responder.
Without using Merge all Windows
, there doesn't seem to be a builtin Safari style tab view. The tab view that is builtin uses system preferences style tabs and I am trying to get Safari/Finder/System style tabs. I don't want to use custom rendered tabs because they won't work and feel the same way the system tabs do.
When window-tabbing is enabled, windows can be grouped in tabs as long as all share the same tabbingIdentifier. AppKit automatically calculates such identifiers based on some context inspection but ignores windows with the titlebarAppearsTransparent
option set.
Therefore just set your own tabbingIdentifier
and you're happy to go.
As a side-note: The user preferred tabbing behavior for newly created or opened documents can be set in System Preferences > Dock.
window.styleMask |= NSWindowStyleMaskFullSizeContentView;
window.titlebarAppearsTransparent = YES;
window.tabbingMode = NSWindowTabbingModeAutomatic
window.tabbingIdentifier = @"MyDocumentWindow";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With