|
@@ -181,7 +181,7 @@ extension KMToolbarItemView {
|
|
|
if self._popOver == nil || self._popOver!.isEqual(to: newValue) == false {
|
|
|
self._popOver = newValue
|
|
|
if (newValue != nil) {
|
|
|
- self.layer?.backgroundColor = self.selectedBackgroundColor.cgColor
|
|
|
+ self.layer?.backgroundColor = Self.selectedBackgroundColor.cgColor
|
|
|
} else {
|
|
|
self._updateSelectBackground()
|
|
|
}
|
|
@@ -304,9 +304,9 @@ extension KMToolbarItemView {
|
|
|
}
|
|
|
if (!self.isSelected) {
|
|
|
if self.selectBackgroundType == .none {
|
|
|
- self.layer?.backgroundColor = self.selectedBackgroundColor.cgColor
|
|
|
+ self.layer?.backgroundColor = Self.selectedBackgroundColor.cgColor
|
|
|
} else {
|
|
|
- self.imageViewBox.fillColor = self.selectedBackgroundColor
|
|
|
+ self.imageViewBox.fillColor = Self.selectedBackgroundColor
|
|
|
}
|
|
|
|
|
|
if(self.image != nil && self.alternateImage != nil) {
|
|
@@ -375,18 +375,25 @@ extension KMToolbarItemView {
|
|
|
private func _updateSelectBackground() {
|
|
|
if self.selectBackgroundType == .none {
|
|
|
if self.isSelected {
|
|
|
- self.layer?.backgroundColor = self.selectedBackgroundColor.cgColor
|
|
|
+ self.layer?.backgroundColor = Self.selectedBackgroundColor.cgColor
|
|
|
} else {
|
|
|
self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
|
|
|
}
|
|
|
} else if self.selectBackgroundType == .imageBox {
|
|
|
if self.isSelected {
|
|
|
- self.imageViewBox.fillColor = self.selectedBackgroundColor
|
|
|
+ self.imageViewBox.fillColor = Self.selectedBackgroundColor
|
|
|
} else {
|
|
|
self.imageViewBox.fillColor = self.normalBackgroundColor
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// override func updateLayer() {
|
|
|
+// super.updateLayer()
|
|
|
+//
|
|
|
+// self.wantsLayer = true
|
|
|
+// self.layer?.backgroundColor = KMAppearance.Layout.l_2Color().cgColor
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
// MARK: - Private Methods
|