|
@@ -82,6 +82,9 @@ extension KMToolbarItemView {
|
|
|
self.nameBtn.isEnabled = !self.unEnabled
|
|
|
self.imageViewBtn.isEnabled = !self.unEnabled
|
|
|
self.needExpandButton.isEnabled = !self.unEnabled
|
|
|
+ if self.customizeView != nil {
|
|
|
+ self.subviewsdEnable(view: self.customizeView!, isEnable: !self.unEnabled)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
var isShowCustomToolTip = false {
|
|
@@ -766,3 +769,28 @@ extension KMToolbarItemView: KMCustomButtonPopMenuViewControllerDelegate, KMCust
|
|
|
return true
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+extension KMToolbarItemView {
|
|
|
+ func subviewsdEnable(view: NSView, isEnable: Bool) {
|
|
|
+ if ((view as? NSButton) != nil) {
|
|
|
+ (view as! NSButton).isEnabled = isEnable
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((view as? NSTextField) != nil) {
|
|
|
+ (view as! NSTextField).isEnabled = isEnable
|
|
|
+ }
|
|
|
+
|
|
|
+ for subview in view.subviews {
|
|
|
+ if subview.subviews.count != 0 {
|
|
|
+ self.subviewsdEnable(view: subview, isEnable: isEnable)
|
|
|
+ }
|
|
|
+ if ((subview as? NSButton) != nil) {
|
|
|
+ (subview as! NSButton).isEnabled = isEnable
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((subview as? NSTextField) != nil) {
|
|
|
+ (subview as! NSTextField).isEnabled = isEnable
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|