mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macOS: Simplify native title hiding logic for titlebar tabs.
This commit is contained in:
@ -45,19 +45,10 @@ class TerminalWindow: NSWindow {
|
|||||||
self.toolbar = TerminalToolbar(identifier: "Toolbar")
|
self.toolbar = TerminalToolbar(identifier: "Toolbar")
|
||||||
}
|
}
|
||||||
|
|
||||||
// We directly hide the view containing the title text because if we use the
|
// We have to wait before setting the titleVisibility or else it prevents
|
||||||
// `titleVisibility` property for this it prevents the window from hiding the
|
// the window from hiding the tab bar when we get down to a single tab.
|
||||||
// tab bar when we get down to a single tab.
|
DispatchQueue.main.async {
|
||||||
if let toolbarTitleView = contentView?.superview?.subviews.first(where: {
|
self.titleVisibility = .hidden
|
||||||
$0.className == "NSTitlebarContainerView"
|
|
||||||
})?.subviews.first(where: {
|
|
||||||
$0.className == "NSTitlebarView"
|
|
||||||
})?.subviews.first(where: {
|
|
||||||
$0.className == "NSToolbarView"
|
|
||||||
})?.subviews.first(where: {
|
|
||||||
$0.className == "NSToolbarTitleView"
|
|
||||||
}) {
|
|
||||||
toolbarTitleView.isHidden = true
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// "expanded" places the toolbar below the titlebar, so setting this style and
|
// "expanded" places the toolbar below the titlebar, so setting this style and
|
||||||
|
Reference in New Issue
Block a user