Selaa lähdekoodia

【综合】Toolbar icon在选中背景中未居中(已修复)

tangchao 11 kuukautta sitten
vanhempi
commit
6823edf8c5

+ 12 - 12
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarItemView.swift

@@ -407,11 +407,11 @@ extension KMToolbarItemView {
             return
         }
         if (!self.isSelected) {
-//            if self.selectBackgroundType == .none {
+            if self.selectBackgroundType == .none {
                 self.layer?.backgroundColor = Self.selectedBackgroundColor.cgColor
-//            } else {
-//                self.imageViewBox.fillColor = Self.selectedBackgroundColor
-//            }
+            } else {
+                self.imageViewBox.fillColor = Self.selectedBackgroundColor
+            }
             
             if(self.image != nil && self.alternateImage != nil) {
                 self._kNormalImage = self.image
@@ -438,11 +438,11 @@ extension KMToolbarItemView {
         super.mouseExited(with: event)
         
         if (!self.isSelected && !self.needExpandAction) {
-//            if self.selectBackgroundType == .none {
+            if self.selectBackgroundType == .none {
                 self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
-//            } else {
-//                self.imageViewBox.fillColor = self.normalBackgroundColor
-//            }
+            } else {
+                self.imageViewBox.fillColor = self.normalBackgroundColor
+            }
            
             if(self.image != nil && self.alternateImage != nil) {
                 self.imageViewBtn.image = self._kNormalImage ?? self.image!
@@ -450,11 +450,11 @@ extension KMToolbarItemView {
         }
 
         if(self.needExpandAction && !self.isSelected) {
-//            if self.selectBackgroundType == .none {
+            if self.selectBackgroundType == .none {
                 self.layer?.backgroundColor = self.normalBackgroundColor.cgColor
-//            } else {
-//                self.imageViewBox.fillColor = self.normalBackgroundColor
-//            }
+            } else {
+                self.imageViewBox.fillColor = self.normalBackgroundColor
+            }
             
             if(self.image != nil && self.alternateImage != nil) {
                 self.imageViewBtn.image = self._kNormalImage ?? self.image!