Browse Source

Merge branch 'develop_PDFReaderProNew' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProNew

tangchao 10 months ago
parent
commit
4371fbbe08

+ 9 - 9
PDF Office/PDF Master/Class/PDFTools/Redact/Controller/KMPDFRedactViewController.xib

@@ -1,12 +1,12 @@
 <?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="22155" 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="22155"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMPDFRedactViewController" customModule="PDF_Master" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMPDFRedactViewController" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
                 <outlet property="applyBox" destination="p57-Ip-T2T" id="wb7-JQ-7Sy"/>
                 <outlet property="applyButton" destination="jgL-Z5-PR3" id="fHy-NQ-YtV"/>
@@ -47,7 +47,7 @@
                                         </constraints>
                                         <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameButtonRedactText" id="10J-Vc-p1f"/>
                                     </imageView>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bf1-3b-pkO">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bf1-3b-pkO">
                                         <rect key="frame" x="36" y="4" width="37" height="16"/>
                                         <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="SQB-JZ-YQd">
                                             <font key="font" metaFont="system"/>
@@ -55,7 +55,7 @@
                                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         </textFieldCell>
                                     </textField>
-                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ryk-qe-WA4" customClass="KMCustomButton" customModule="PDF_Master" customModuleProvider="target">
+                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ryk-qe-WA4" customClass="KMCustomButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                         <rect key="frame" x="0.0" y="0.0" width="81" height="24"/>
                                         <buttonCell key="cell" type="bevel" bezelStyle="regularSquare" alignment="center" state="on" imageScaling="proportionallyDown" inset="2" id="HKN-QE-F2Y">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -79,7 +79,7 @@
                                 <constraint firstAttribute="height" constant="24" id="cDN-lX-Jb8"/>
                             </constraints>
                         </box>
-                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YU9-ht-l5r">
+                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YU9-ht-l5r">
                             <rect key="frame" x="14" y="12" width="60" height="17"/>
                             <textFieldCell key="cell" lineBreakMode="clipping" title="Edit PDF" id="xwB-CI-KY9">
                                 <font key="font" metaFont="system" size="14"/>
@@ -151,7 +151,7 @@
                                         </constraints>
                                         <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="KMImageNameButtonRedactProperties" id="ORk-5j-x9i"/>
                                     </imageView>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9vB-gG-Xmd">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9vB-gG-Xmd">
                                         <rect key="frame" x="36" y="4" width="37" height="16"/>
                                         <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="RIY-Ss-doB">
                                             <font key="font" metaFont="system"/>
@@ -159,7 +159,7 @@
                                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         </textFieldCell>
                                     </textField>
-                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="G4u-HY-WcV" customClass="KMCustomButton" customModule="PDF_Master" customModuleProvider="target">
+                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="G4u-HY-WcV" customClass="KMCustomButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                         <rect key="frame" x="0.0" y="0.0" width="81" height="24"/>
                                         <buttonCell key="cell" type="bevel" bezelStyle="regularSquare" alignment="center" state="on" imageScaling="proportionallyDown" inset="2" id="pAw-R5-ae6">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -203,7 +203,7 @@
                         <constraint firstItem="iwX-y1-ea2" firstAttribute="centerY" secondItem="2S1-Gb-ePE" secondAttribute="centerY" id="sWN-bH-6QS"/>
                     </constraints>
                 </customView>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="Ljd-Vm-9rM" customClass="KMRedactPDFView" customModule="PDF_Master" customModuleProvider="target">
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="Ljd-Vm-9rM" customClass="KMRedactPDFView" customModule="PDF_Reader_Pro" customModuleProvider="target">
                     <rect key="frame" x="0.0" y="0.0" width="1000" height="321"/>
                 </customView>
             </subviews>

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Redact/Tools/KMPDFAnnotationRedactConfig.swift

@@ -57,7 +57,7 @@ class KMPDFAnnotationRedactConfig: NSObject {
         get {
             let fontColor = UserDefaults.standard.color(forKey: KMPDFAnnotationRedactFontColor)
             if fontColor == nil {
-                return NSColor.black
+                return NSColor.red
             }
             return fontColor
         }

+ 1 - 0
PDF Office/PDF Master/Class/PDFTools/Redact/View/KMRedactPDFView.swift

@@ -544,6 +544,7 @@ extension KMRedactPDFView {
                     annotation?.setFont(anno.font())
                     annotation?.setOverlayText(anno.overlayText())
                     annotation?.setFontColor(anno.fontColor())
+                    annotation?.setAlignment(anno.alignment())
                     
                     let pageRect = page?.bounds ?? .zero
                     let annotationRect  = annotation?.bounds ?? .zero

+ 18 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -3594,6 +3594,24 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
             break;
         case CAnnotationTypeTextField:{
             CPDFTextWidgetAnnotation *textWidget = [[CPDFTextWidgetAnnotation alloc] initWithKMNoteBounds:bounds document:self.document];
+            textWidget.stringValue = NSLocalizedString(@"", nil);
+            NSColor* backgroundColor = [sud colorForKey:CAnnotationTextWidgetBackgroundColorKey];
+            if (backgroundColor) {
+                textWidget.backgroundColor = backgroundColor;
+            } else {
+                textWidget.backgroundColor = [NSColor clearColor];
+            }
+            
+            NSColor* fontColor = [sud colorForKey:CAnnotationTextWidgetFontColorKey];
+            if (fontColor) {
+                textWidget.fontColor = fontColor;
+            }
+            textWidget.alignment = [sud integerForKey:CAnnotationTextWidgetAlignmenKey];
+            NSFont *font = [sud fontForNameKey:SKAnnotationTextWidgetFontNameKey sizeKey:SKAnnotationTextWidgetFontSizeKey];
+            if (font) {
+                textWidget.font = font;
+            }
+            textWidget.isMultiline = [sud boolForKey:CAnnotationTextWidgetMultilineKey];
             newAnnotation = textWidget;
         }
             break;

+ 1 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/FormProperties/KMAnnotationButtonOptionsViewController.swift

@@ -44,6 +44,7 @@ private let LinkHyperlink = "https://www.pdfreaderpro.com"
         actionSelectActionLabel.stringValue = NSLocalizedString("Select Action", comment: "")
         actionSelectActionLabel.textColor = KMAppearance.Layout.h1Color()
         
+        actionSendEmailLabel.stringValue = NSLocalizedString("Send email to", comment: "")
         actionSendEmailLabel.textColor = KMAppearance.Layout.h1Color()
         
         actionLabelTextField.wantsLayer = true

+ 13 - 13
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/FormProperties/KMAnnotationFromViewController.swift

@@ -196,7 +196,7 @@ import Cocoa
 
                         let menu = NSMenu()
                         for (index, fontName) in fonts.enumerated() {
-                            if let font = NSFont(name: fontName, size: annotation!.fontSize()) {
+                            if let font = NSFont(name: fontName, size: 12.0/*annotation!.fontSize()*/) {
                                 let attributes: [NSAttributedString.Key: Any] = [.font: font]
                                 let attributedString = NSAttributedString(string: fontName, attributes: attributes)
                                 let item = NSMenuItem()
@@ -245,7 +245,7 @@ import Cocoa
                 let style = annotationFont.fontDescriptor.object(forKey: NSFontDescriptor.AttributeName.face) as? String
                 let menu = NSMenu()
                 for (index, fontName) in fonts.enumerated() {
-                    if let font = NSFont(name: fontName, size: annotationModel.fontSize()) {
+                    if let font = NSFont(name: fontName, size: 12.0/*annotation!.fontSize()*/) {
                         let attributes: [NSAttributedString.Key: Any] = [.font: font]
                         let attributedString = NSAttributedString(string: fontName, attributes: attributes)
                         let item = NSMenuItem()
@@ -278,22 +278,22 @@ import Cocoa
     func updateAnnotationMode() {
         let userDefaults = UserDefaults.standard
         if formMode == .textField {
-            userDefaults.safe_setColor(annotationModel.backgroundColor(), forKey: SKAnnotationTextWidgetBackgroundColorKey)
-            userDefaults.safe_setColor(annotationModel.fontColor(), forKey: SKAnnotationTextWidgetFontColorKey)
-            userDefaults.set(annotationModel.alignment().rawValue, forKey: SKAnnotationTextWidgetAlignmenKey)
+            userDefaults.safe_setColor(annotationModel.backgroundColor(), forKey: CAnnotationTextWidgetBackgroundColorKey)
+            userDefaults.safe_setColor(annotationModel.fontColor(), forKey: CAnnotationTextWidgetFontColorKey)
+            userDefaults.set(annotationModel.alignment().rawValue, forKey: CAnnotationTextWidgetAlignmenKey)
             userDefaults.set(annotationModel.fontName(), forKey: SKAnnotationTextWidgetFontNameKey)
             userDefaults.set(annotationModel.fontSize(), forKey: SKAnnotationTextWidgetFontSizeKey)
             userDefaults.set(annotationModel.isMultiline(), forKey: SKAnnotationTextMultilineKey)
         } else if formMode == .comboBox {
-            userDefaults.safe_setColor(annotationModel.backgroundColor(), forKey: SKAnnotationChoiceWidgetBackgroundColorKey)
-            userDefaults.safe_setColor(annotationModel.fontColor(), forKey: SKAnnotationChoiceWidgetFontColorKey)
-            userDefaults.set(annotationModel.fontName(), forKey: SKAnnotationChoiceWidgetFontNameKey)
-            userDefaults.set(annotationModel.fontSize(), forKey: SKAnnotationChoiceWidgetFontSizeKey)
+            userDefaults.safe_setColor(annotationModel.backgroundColor(), forKey: CAnnotationChoiceWidgetBackgroundColorKey)
+            userDefaults.safe_setColor(annotationModel.fontColor(), forKey: CAnnotationChoiceWidgetFontColorKey)
+            userDefaults.set(annotationModel.fontName(), forKey: CAnnotationChoiceWidgetFontNameKey)
+            userDefaults.set(annotationModel.fontSize(), forKey: CAnnotationChoiceWidgetFontSizeKey)
         } else if formMode == .listMenu {
-            userDefaults.safe_setColor(annotationModel.backgroundColor(), forKey: SKAnnotationChoiceListWidgetBackgroundColorKey)
-            userDefaults.safe_setColor(annotationModel.fontColor(), forKey: SKAnnotationChoiceListWidgetFontColorKey)
-            userDefaults.set(annotationModel.fontName(), forKey: SKAnnotationChoiceListWidgetFontNameKey)
-            userDefaults.set(annotationModel.fontSize(), forKey: SKAnnotationChoiceListWidgetFontSizeKey)
+            userDefaults.safe_setColor(annotationModel.backgroundColor(), forKey: CAnnotationChoiceListWidgetBackgroundColorKey)
+            userDefaults.safe_setColor(annotationModel.fontColor(), forKey: CAnnotationChoiceListWidgetFontColorKey)
+            userDefaults.set(annotationModel.fontName(), forKey: CAnnotationChoiceListWidgetFontNameKey)
+            userDefaults.set(annotationModel.fontSize(), forKey: CAnnotationChoiceListWidgetFontSizeKey)
         }
     }
     

+ 2 - 2
PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

@@ -11788,13 +11788,13 @@
 		BB4EEF2929763EC7003A3537 /* Window */ = {
 			isa = PBXGroup;
 			children = (
-				BB9599C62B3164B40062D346 /* KMRedactPropertiesWindowController.xib */,
-				BB4EEF3329764166003A3537 /* KMRedactPropertyWindowController.swift */,
 				BB24D4A52977BE6700041659 /* KMRedactConfirmWindowController.swift */,
 				BB24D4A62977BE6700041659 /* KMRedactConfirmWindowController.xib */,
 				BBB14A562978E75D00936EDB /* KMRedactMutilPageFlagWindowController.swift */,
 				BBB14A5E297929BD00936EDB /* KMRedactPageRangeWindowController.swift */,
 				BB9599C22B31647B0062D346 /* KMRedactPropertiesWindowController.swift */,
+				BB9599C62B3164B40062D346 /* KMRedactPropertiesWindowController.xib */,
+				BB4EEF3329764166003A3537 /* KMRedactPropertyWindowController.swift */,
 				BB9599CA2B3184230062D346 /* KMRedactSelectPagesWindowController.swift */,
 				BB9599CE2B3184430062D346 /* KMRedactSelectPagesWindowController.xib */,
 			);