fix: fixed toggle buttons visibility in the settings when they must be disabled

This commit is contained in:
Serhiy Mytrovtsiy
2021-08-02 18:36:09 +02:00
parent 27207b803b
commit 83e6e21ec2

View File

@@ -316,13 +316,13 @@ public extension Array where Element: Hashable {
}
public func findAndToggleNSControlState(_ view: NSView?, state: NSControl.StateValue) {
if let control = view?.subviews.first(where: { $0 is NSControl }) {
if let control = view?.subviews.first(where: { $0 is NSControl && !($0 is NSTextField) }) {
toggleNSControlState(control as? NSControl, state: state)
}
}
public func findAndToggleEnableNSControlState(_ view: NSView?, state: Bool) {
if let control = view?.subviews.first(where: { $0 is NSControl }) {
if let control = view?.subviews.first(where: { $0 is NSControl && !($0 is NSTextField) }) {
toggleEnableNSControlState(control as? NSControl, state: state)
}
}