mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 17:26:09 +03:00
Add comments/docs and make method name clearer
This commit is contained in:
@ -34,6 +34,9 @@ class TerminalWindow: NSWindow {
|
|||||||
// The tab bar controller ID from macOS
|
// The tab bar controller ID from macOS
|
||||||
static private let TabBarController = NSUserInterfaceItemIdentifier("_tabBarController")
|
static private let TabBarController = NSUserInterfaceItemIdentifier("_tabBarController")
|
||||||
|
|
||||||
|
// Look through the titlebar's view hierarchy and hide any of the internal
|
||||||
|
// views used to create a separator between the title/toolbar and unselected
|
||||||
|
// tabs in the tab bar.
|
||||||
override func updateConstraintsIfNeeded() {
|
override func updateConstraintsIfNeeded() {
|
||||||
super.updateConstraintsIfNeeded()
|
super.updateConstraintsIfNeeded()
|
||||||
|
|
||||||
@ -41,7 +44,7 @@ class TerminalWindow: NSWindow {
|
|||||||
$0.className == "NSTitlebarContainerView"
|
$0.className == "NSTitlebarContainerView"
|
||||||
}) else { return }
|
}) else { return }
|
||||||
|
|
||||||
for v in titlebarContainer.subviews(withClassName: "NSTitlebarSeparatorView") {
|
for v in titlebarContainer.descendants(withClassName: "NSTitlebarSeparatorView") {
|
||||||
v.isHidden = true
|
v.isHidden = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
|
|
||||||
extension NSView {
|
extension NSView {
|
||||||
|
/// Recursively finds and returns descendant views that have the given class name.
|
||||||
func subviews(withClassName name: String) -> [NSView] {
|
func descendants(withClassName name: String) -> [NSView] {
|
||||||
var result = [NSView]()
|
var result = [NSView]()
|
||||||
|
|
||||||
for subview in subviews {
|
for subview in subviews {
|
||||||
@ -10,7 +10,7 @@ extension NSView {
|
|||||||
result.append(subview)
|
result.append(subview)
|
||||||
}
|
}
|
||||||
|
|
||||||
result += subview.subviews(withClassName: name)
|
result += subview.descendants(withClassName: name)
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
Reference in New Issue
Block a user