Browse Source

【综合】暗黑模式兼容

niehaoyu 7 months ago
parent
commit
8580a1f533

+ 10 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditImagePropertyViewController.swift

@@ -482,6 +482,9 @@ class KMEditImagePropertyViewController: NSViewController {
             self.hTextFieldItemView.backgroundView.layer?.backgroundColor = .white
             self.hTextFieldItemView.backgroundView.layer?.borderColor = NSColor(hex: "#DFE1E5").cgColor
             
+            self.rightRotateVC?.initDefaultValue()
+            
+            self.leftRotateVC?.initDefaultValue()
         }
         
         for label in [self.whTitleLabel, self.opacityTitleLabel,
@@ -750,6 +753,13 @@ class KMEditImagePropertyViewController: NSViewController {
     private func _trackAlignEvent() {
         kTrackEventManager.trackEvent(event: "SubTbr_EditPDF", withProperties: ["SubTbr_EditText":"SubTbr_EditContent_AlignContent"])
     }
+    
+    //MARK: - MouseEvent
+    override func mouseDown(with event: NSEvent) {
+        super.mouseDown(with: event)
+        
+        self.view.window?.makeFirstResponder(nil)
+    }
 }
 
 //MARK: - Action

+ 8 - 8
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditImagePropertyViewController.xib

@@ -66,7 +66,7 @@
                                     <rect key="frame" x="0.0" y="0.0" width="260" height="176"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <subviews>
-                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="x6y-yu-lpY">
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="x6y-yu-lpY">
                                             <rect key="frame" x="14" y="144" width="41" height="16"/>
                                             <textFieldCell key="cell" lineBreakMode="clipping" title="Image" id="F3k-6q-vFG">
                                                 <font key="font" usesAppearanceFont="YES"/>
@@ -74,7 +74,7 @@
                                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                             </textFieldCell>
                                         </textField>
-                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hgU-r9-q9f">
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hgU-r9-q9f">
                                             <rect key="frame" x="14" y="110" width="37" height="16"/>
                                             <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="5Xn-4H-Ifh">
                                                 <font key="font" metaFont="system"/>
@@ -107,7 +107,7 @@
                                                 <constraint firstAttribute="width" constant="94" id="cEC-d9-E3a"/>
                                             </constraints>
                                         </customView>
-                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hif-FL-3vF">
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hif-FL-3vF">
                                             <rect key="frame" x="14" y="42" width="37" height="16"/>
                                             <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="79h-GY-A9Z">
                                                 <font key="font" metaFont="system"/>
@@ -176,7 +176,7 @@
                                     <rect key="frame" x="0.0" y="0.0" width="260" height="56"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <subviews>
-                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="XPI-yz-g9u">
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="XPI-yz-g9u">
                                             <rect key="frame" x="14" y="40" width="49" height="16"/>
                                             <textFieldCell key="cell" lineBreakMode="clipping" title="opacity" id="LXH-cy-YvE">
                                                 <font key="font" usesAppearanceFont="YES"/>
@@ -234,7 +234,7 @@
                                     <rect key="frame" x="0.0" y="0.0" width="260" height="58"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <subviews>
-                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="eCo-1Z-05J">
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="eCo-1Z-05J">
                                             <rect key="frame" x="14" y="42" width="37" height="16"/>
                                             <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="7YT-SN-29T">
                                                 <font key="font" usesAppearanceFont="YES"/>
@@ -276,7 +276,7 @@
                                     <rect key="frame" x="0.0" y="0.0" width="228" height="136"/>
                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                     <subviews>
-                                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dbS-0w-mS5">
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dbS-0w-mS5">
                                             <rect key="frame" x="-2" y="120" width="37" height="16"/>
                                             <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="Tba-gg-Mvz">
                                                 <font key="font" usesAppearanceFont="YES"/>
@@ -381,7 +381,7 @@
                                         </constraints>
                                         <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="VmL-3i-3hR"/>
                                     </imageView>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cBS-ZD-gNe">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cBS-ZD-gNe">
                                         <rect key="frame" x="94" y="152" width="73" height="16"/>
                                         <textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Add Image" id="BJo-l6-NBY">
                                             <font key="font" metaFont="system"/>
@@ -389,7 +389,7 @@
                                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         </textFieldCell>
                                     </textField>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xT8-m7-QlU">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xT8-m7-QlU">
                                         <rect key="frame" x="44" y="112" width="172" height="40"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="168" id="Fhy-XT-ZBN"/>

+ 15 - 8
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift

@@ -537,10 +537,12 @@ class KMEditPDFTextPropertyViewController: NSViewController {
             self.fontBoldVC?.background_act = KMAppearance.Interactive.m1Color()
             self.fontBoldVC?.background_hov = NSColor(red: 71/255, green: 72/255, blue: 75/255, alpha: 1)
             self.fontBoldVC?.borderColor_hov = KMAppearance.Interactive.a0Color()
+            self.fontBoldVC?.borderWidth_act = 0
             
             self.fontItalicVC?.background_act = KMAppearance.Interactive.m1Color()
             self.fontItalicVC?.background_hov = NSColor(red: 71/255, green: 72/255, blue: 75/255, alpha: 1)
             self.fontItalicVC?.borderColor_hov = KMAppearance.Interactive.a0Color()
+            self.fontItalicVC?.borderWidth_act = 0
             
             self.fontAddVC?.background_act = KMAppearance.Interactive.m1Color()
             self.fontAddVC?.background_hov = NSColor(red: 71/255, green: 72/255, blue: 75/255, alpha: 1)
@@ -550,12 +552,10 @@ class KMEditPDFTextPropertyViewController: NSViewController {
             self.fontReduceVC?.background_hov = NSColor(red: 71/255, green: 72/255, blue: 75/255, alpha: 1)
             self.fontReduceVC?.borderColor_hov = KMAppearance.Interactive.a0Color()
             
-            self.leftAlignmentVC?.background_sel = NSColor(red: 71/255, green: 72/255, blue: 75/255, alpha: 1)
-            
-            self.centerAlignmentVC?.background_sel = NSColor(red: 71/255, green: 72/255, blue: 75/255, alpha: 1)
-            
-            self.rightAlignmentVC?.background_sel = NSColor(red: 71/255, green: 72/255, blue: 75/255, alpha: 1)
-            
+            self.leftAlignmentVC?.background_sel = KMAppearance.Interactive.m1Color()
+            self.centerAlignmentVC?.background_sel = KMAppearance.Interactive.m1Color()
+            self.rightAlignmentVC?.background_sel = KMAppearance.Interactive.m1Color()
+ 
         } else {
             self.backgroundView.backgroundColor(NSColor.km_init(hex: "#FAFAFA"))
 
@@ -622,13 +622,16 @@ class KMEditPDFTextPropertyViewController: NSViewController {
             textPresuppositionVC?.popViewControllerTextColor = KMAppearance.Layout.h0Color()
             textPresuppositionVC?.popViewControllerEnterFillColor = KMAppearance.Interactive.s0Color()
             
-            textPresuppositionResetVC?.borderColor = KMAppearance.Layout.w15Color()
+            textPresuppositionResetVC?.borderColor = NSColor(red: 223/255, green: 225/255, blue: 229/255, alpha: 1)
             textPresuppositionResetVC?.borderColor_hov = NSColor.clear
             textPresuppositionResetVC?.borderColor_sel = KMAppearance.Layout.w15Color()
-            textPresuppositionResetVC?.background = KMAppearance.Layout.l1Color()
+            textPresuppositionResetVC?.borderColor_act = KMAppearance.Layout.w15Color()
+            textPresuppositionResetVC?.borderColor_disabled = KMAppearance.Layout.w15Color()
+            textPresuppositionResetVC?.background = NSColor.white
             textPresuppositionResetVC?.background_hov = KMAppearance.view_bg_dis_color()
             textPresuppositionResetVC?.background_disabled = KMAppearance.view_bg_dis_color()
             textPresuppositionResetVC?.borderColor_disabled = KMAppearance.view_border_dis_color()
+            textPresuppositionResetVC?.borderWidth = 1
             
             opacitVC?.borderColor = KMAppearance.Interactive.s0Color()
             opacitVC?.background = KMAppearance.Layout.l1Color()
@@ -640,6 +643,10 @@ class KMEditPDFTextPropertyViewController: NSViewController {
             opacitVC?.popViewControllerBackground = KMAppearance.Layout.bgColor()
             opacitVC?.popViewControllerTextColor = KMAppearance.Layout.h0Color()
             opacitVC?.popViewControllerEnterFillColor = KMAppearance.Interactive.s0Color()
+            
+            self.fontBoldVC?.initDefaultValue()
+            
+            self.fontItalicVC?.initDefaultValue()
         }
     }
     

+ 16 - 16
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="System colors introduced in macOS 10.13" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -80,7 +80,7 @@
                                     <constraint firstAttribute="height" constant="88" id="QxJ-yS-QZJ"/>
                                 </constraints>
                             </box>
-                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="TmC-Oc-Dxd">
+                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="TmC-Oc-Dxd">
                                 <rect key="frame" x="14" y="616" width="30" height="16"/>
                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Text" id="tZm-OE-Wdr">
                                     <font key="font" usesAppearanceFont="YES"/>
@@ -91,7 +91,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="LHG-XG-Y6G">
                                 <rect key="frame" x="16" y="263" width="228" height="193"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2gN-hL-7Ez">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2gN-hL-7Ez">
                                         <rect key="frame" x="-2" y="165" width="30" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="Xp1-BT-pjJ"/>
@@ -104,14 +104,14 @@
                                     </textField>
                                     <button hidden="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ae7-Z5-hap">
                                         <rect key="frame" x="212" y="167" width="16" height="16"/>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="16" id="DiF-Xr-bR1"/>
-                                            <constraint firstAttribute="height" constant="16" id="buS-De-0SL"/>
-                                        </constraints>
                                         <buttonCell key="cell" type="bevel" bezelStyle="regularSquare" image="KMImageNameBtnFontsetNor" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="ArP-Fo-MWG">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="16" id="DiF-Xr-bR1"/>
+                                            <constraint firstAttribute="height" constant="16" id="buS-De-0SL"/>
+                                        </constraints>
                                     </button>
                                     <box boxType="custom" cornerRadius="4" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="Dcy-0U-AoP">
                                         <rect key="frame" x="170" y="5" width="58" height="32"/>
@@ -121,28 +121,28 @@
                                             <subviews>
                                                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Rrw-k0-Lul">
                                                     <rect key="frame" x="32" y="5" width="20" height="20"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="width" constant="20" id="PbZ-2N-epC"/>
-                                                        <constraint firstAttribute="height" constant="20" id="RRU-pT-bQL"/>
-                                                    </constraints>
                                                     <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="buttonCell:TIB-ws-deg:image" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="TIB-ws-deg">
                                                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                         <font key="font" metaFont="system"/>
                                                     </buttonCell>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="20" id="PbZ-2N-epC"/>
+                                                        <constraint firstAttribute="height" constant="20" id="RRU-pT-bQL"/>
+                                                    </constraints>
                                                     <connections>
                                                         <action selector="fontColorAction:" target="-2" id="ou8-ks-dpX"/>
                                                     </connections>
                                                 </button>
                                                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KRu-kj-Nkf">
                                                     <rect key="frame" x="4" y="5" width="20" height="20"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="height" constant="20" id="8zk-Dk-Xu3"/>
-                                                        <constraint firstAttribute="width" constant="20" id="Xoc-NP-7or"/>
-                                                    </constraints>
                                                     <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="LZD-Xh-ewn">
                                                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                         <font key="font" metaFont="system"/>
                                                     </buttonCell>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="20" id="8zk-Dk-Xu3"/>
+                                                        <constraint firstAttribute="width" constant="20" id="Xoc-NP-7or"/>
+                                                    </constraints>
                                                 </button>
                                             </subviews>
                                             <constraints>