comments
parent
00d41239da
commit
b1b74d3421
|
|
@ -25,8 +25,8 @@ class TitlebarTabsTahoeTerminalWindow: TransparentTitlebarTerminalWindow, NSTool
|
||||||
didSet{
|
didSet{
|
||||||
guard toolbar != nil else { return }
|
guard toolbar != nil else { return }
|
||||||
|
|
||||||
// When a toolbar is added, remove the Liquid Glass look because we're
|
// When a toolbar is added, remove the Liquid Glass look to have a cleaner
|
||||||
// abusing the toolbar as a tab bar.
|
// appearance for our custom titlebar tabs.
|
||||||
if let glass = titlebarContainer?.firstDescendant(withClassName: "NSGlassContainerView") {
|
if let glass = titlebarContainer?.firstDescendant(withClassName: "NSGlassContainerView") {
|
||||||
glass.isHidden = true
|
glass.isHidden = true
|
||||||
}
|
}
|
||||||
|
|
@ -110,9 +110,9 @@ class TitlebarTabsTahoeTerminalWindow: TransparentTitlebarTerminalWindow, NSTool
|
||||||
/// creates/moves (unsure which) the NSTabBar for it and shows it. When it loses main, the tab bar
|
/// creates/moves (unsure which) the NSTabBar for it and shows it. When it loses main, the tab bar
|
||||||
/// is removed from the view hierarchy.
|
/// is removed from the view hierarchy.
|
||||||
///
|
///
|
||||||
/// We can't detect this via `addTitlebarAccessoryViewController` because AppKit
|
/// We can't reliably detect this via `addTitlebarAccessoryViewController` because AppKit
|
||||||
/// _always_ creates an accessory view controller for every window in the tab group, but puts a
|
/// creates an accessory view controller for every window in the tab group, but only attaches
|
||||||
/// zero-sized NSView into it (that the tab bar is then attached to later).
|
/// the actual NSTabBar to the main window's accessory view.
|
||||||
///
|
///
|
||||||
/// The best way I've found to detect this is to search for and setup the tab bar anytime the
|
/// The best way I've found to detect this is to search for and setup the tab bar anytime the
|
||||||
/// window gains focus. There are probably edge cases to check but to resolve all this I made
|
/// window gains focus. There are probably edge cases to check but to resolve all this I made
|
||||||
|
|
@ -167,10 +167,10 @@ class TitlebarTabsTahoeTerminalWindow: TransparentTitlebarTerminalWindow, NSTool
|
||||||
clipView.needsLayout = true
|
clipView.needsLayout = true
|
||||||
accessoryView.needsLayout = true
|
accessoryView.needsLayout = true
|
||||||
|
|
||||||
// We need to setup an observer for the NSTabBar frame. When we change system
|
// Setup an observer for the NSTabBar frame. When system appearance changes or
|
||||||
// appearance, the tab bar temporarily becomes width/height 0 and breaks all our
|
// other events occur, the tab bar can temporarily become zero-sized. When this
|
||||||
// constraints and AppKit responds by nuking the whole tab bar cause it doesn't
|
// happens, we need to remove our custom constraints and re-apply them once the
|
||||||
// know what to do with it. We need to detect this before bad things happen.
|
// tab bar has proper dimensions again to avoid constraint conflicts.
|
||||||
tabBar.postsFrameChangedNotifications = true
|
tabBar.postsFrameChangedNotifications = true
|
||||||
tabBarObserver = NotificationCenter.default.addObserver(
|
tabBarObserver = NotificationCenter.default.addObserver(
|
||||||
forName: NSView.frameDidChangeNotification,
|
forName: NSView.frameDidChangeNotification,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue