Make things work with really dark backgrounds

This fixes issue #1549
This commit is contained in:
Pete Schaffner
2024-04-02 22:28:34 +02:00
parent bbe35ee02e
commit f086bff651
2 changed files with 133 additions and 65 deletions

View File

@@ -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
}
}