|
@@ -34,6 +34,7 @@ public class ComponentGroup: NSView, NibLoadable {
|
|
|
|
|
|
public var clickedAutoHide = true //点击Item后,是否自动隐藏
|
|
|
|
|
|
+ var superGroupView: ComponentGroup?
|
|
|
var subGroupView: ComponentGroup!
|
|
|
|
|
|
var choosedIndex: Int = -1
|
|
@@ -313,6 +314,8 @@ public class ComponentGroup: NSView, NibLoadable {
|
|
|
return
|
|
|
}
|
|
|
subGroupView.showSubGroupWithPoint(point)
|
|
|
+ subGroupView.superGroupView = self
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//MARK: - Private Method
|
|
@@ -416,8 +419,14 @@ extension ComponentGroup: NSCollectionViewDataSource {
|
|
|
DispatchQueue.main.async {
|
|
|
let property = view.properties
|
|
|
if self?.clickedAutoHide == true {
|
|
|
- self?.groupDelegate?.componentGroupDidDismiss?(group: self)
|
|
|
- self?.removeGroupView()
|
|
|
+// self?.groupDelegate?.componentGroupDidDismiss?(group: self)
|
|
|
+// self?.removeGroupView()
|
|
|
+
|
|
|
+ self?.leftMouseDownAction()
|
|
|
+
|
|
|
+ if let superGroupView = self?.superGroupView {
|
|
|
+ superGroupView.leftMouseDownAction()
|
|
|
+ }
|
|
|
}
|
|
|
self?.groupDelegate?.componentGroupDidSelect?(group: self, menuItemProperty: property)
|
|
|
}
|