Browse Source

【自定义图章】暗黑模式兼容优化

niehaoyu 8 months ago
parent
commit
6ea58a8bec

+ 7 - 6
PDF Office/PDF Master/Class/PDFTools/CustomStamp/Views/CustomStampTopToolbar.swift

@@ -17,6 +17,7 @@ class CustomStampTopToolbar: NSView, NibLoadable {
     @IBOutlet var reduceBtn: KMButton!
     
     @IBOutlet var zoomView: NSView!
+    @IBOutlet var zoomBox: NSBox!
     @IBOutlet var zoomButton: NSPopUpButton!
     @IBOutlet weak var zoomTextField: NSTextField!
     
@@ -46,7 +47,8 @@ class CustomStampTopToolbar: NSView, NibLoadable {
         
         self.zoomView.wantsLayer = true
         self.zoomView.layer?.cornerRadius = 1
-        self.zoomView.layer?.borderWidth = 1
+        self.zoomView.layer?.masksToBounds = true
+        self.zoomBox.borderWidth = 1
         
         self.zoomTextField.delegate = self
         
@@ -100,15 +102,14 @@ class CustomStampTopToolbar: NSView, NibLoadable {
             self.titleLabel.textColor = KMAppearance.Layout.h1Color()
             self.seplineView1.layer?.backgroundColor = NSColor.white.withAlphaComponent(0.1).cgColor
             self.seplineView2.layer?.backgroundColor = NSColor.white.withAlphaComponent(0.1).cgColor
-            self.zoomView.layer?.borderColor = KMAppearance.Interactive.s0Color().cgColor
-            self.zoomView.layer?.backgroundColor = KMAppearance.Layout.l1Color().cgColor
-            
+            self.zoomBox.borderColor = KMAppearance.Interactive.s0Color()
+            self.zoomBox.fillColor = KMAppearance.Layout.l1Color()
         } else {
             self.titleLabel.textColor = NSColor.black.withAlphaComponent(0.85)
             self.seplineView1.layer?.backgroundColor = NSColor.black.withAlphaComponent(0.1).cgColor
             self.seplineView2.layer?.backgroundColor = NSColor.black.withAlphaComponent(0.1).cgColor
-            self.zoomView.layer?.borderColor = KMAppearance.Interactive.s0Color().cgColor
-            self.zoomView.layer?.backgroundColor = KMAppearance.Layout.l1Color().cgColor
+            self.zoomBox.borderColor = KMAppearance.Interactive.s0Color()
+            self.zoomBox.fillColor = KMAppearance.Layout.l1Color()
         }
     }
     

+ 9 - 0
PDF Office/PDF Master/Class/PDFTools/CustomStamp/Views/CustomStampTopToolbar.xib

@@ -76,6 +76,14 @@
                         <view translatesAutoresizingMaskIntoConstraints="NO" id="jN7-4i-gsq">
                             <rect key="frame" x="281" y="5" width="84" height="23"/>
                             <subviews>
+                                <box fixedFrame="YES" boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="g8H-7m-uqn">
+                                    <rect key="frame" x="0.0" y="0.0" width="84" height="23"/>
+                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    <view key="contentView" id="rez-PY-1ZB">
+                                        <rect key="frame" x="0.0" y="0.0" width="84" height="23"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    </view>
+                                </box>
                                 <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZIq-LE-awg">
                                     <rect key="frame" x="0.0" y="3" width="69" height="16"/>
                                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" focusRingType="none" alignment="center" title="100%" drawsBackground="YES" id="D7u-7E-JS8">
@@ -216,6 +224,7 @@
                 <outlet property="seplineView1" destination="F77-jK-ANe" id="LEg-4h-ojm"/>
                 <outlet property="seplineView2" destination="k5b-87-eUi" id="Ql1-ru-2sa"/>
                 <outlet property="titleLabel" destination="ATj-pD-FAo" id="X2b-bm-8Nj"/>
+                <outlet property="zoomBox" destination="g8H-7m-uqn" id="KlY-OL-cAE"/>
                 <outlet property="zoomButton" destination="gRa-Zg-uN7" id="EqB-ze-uN7"/>
                 <outlet property="zoomTextField" destination="ZIq-LE-awg" id="Zug-hY-o3S"/>
                 <outlet property="zoomView" destination="jN7-4i-gsq" id="ZT8-Uh-gKC"/>