mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-28 22:18:36 +00:00
@@ -28,4 +28,17 @@ extension NSView {
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/// Recursively finds and returns the first descendant view that has the given identifier.
|
||||
func firstDescendant(withID id: String) -> NSView? {
|
||||
for subview in subviews {
|
||||
if subview.identifier == NSUserInterfaceItemIdentifier(id) {
|
||||
return subview
|
||||
} else if let found = subview.firstDescendant(withID: id) {
|
||||
return found
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user