Browse Source

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

niehaoyu 10 months ago
parent
commit
04bad9d597

+ 10 - 3
PDF Office/PDF Master/Class/PDFTools/Watermark/New/View/KMWatermarkView.swift

@@ -94,7 +94,16 @@ class KMWatermarkView: KMBaseXibView, NSTextFieldDelegate, NSComboBoxDelegate, N
     var password: String = ""
     var originalWatermark: KMWatermarkModel = KMWatermarkModel()
     var watermark: KMWatermarkModel = KMWatermarkModel()
-    var type: KMWatermarkManagerType = .use
+    var type: KMWatermarkManagerType = .use {
+        didSet {
+            if type == .edit {
+                
+            } else {
+                watermark.watermarkID = KMWatermarkManager.defaultManager.fetchAvailableName()
+            }
+            self.templateNameTextField.stringValue = self.watermark.watermarkID
+        }
+    }
     var pdfDocument: CPDFDocument? {
         didSet {
             self._fileAttri = KMFileAttribute()
@@ -251,8 +260,6 @@ class KMWatermarkView: KMBaseXibView, NSTextFieldDelegate, NSComboBoxDelegate, N
         self.horizentalGapTextField.delegate = self
         self.spacingHorTextField.delegate = self
         self.spacingVerTextField.delegate = self
-        
-        watermark.watermarkID = KMWatermarkManager.defaultManager.fetchAvailableName()
     }
 
     

+ 3 - 3
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFAnnotationExtensions/CPDFAnnotationModel.m

@@ -1760,7 +1760,7 @@
         NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
         switch (_annotationType) {
             case CAnnotationTypeTextField:
-                backgroundColor = [userDefaults PDFListViewColorForKey:CAnnotationTextWidgetBackgroundColorKey];
+                backgroundColor = [userDefaults PDFListViewColorForKey:CAnnotationTextWidgetBackgroundColorKey] ? : NSColor.grayColor;
                 break;
             case CAnnotationTypeRadioButton:
                 backgroundColor = [userDefaults PDFListViewColorForKey:CAnnotationRadioButtonWidgetBackgroundColorKey];
@@ -1769,10 +1769,10 @@
                 backgroundColor = [userDefaults PDFListViewColorForKey:CAnnotationCheckBoxWidgetBackgroundColorKey];
                 break;
             case CAnnotationTypeComboBox:
-                backgroundColor = [userDefaults PDFListViewColorForKey:CAnnotationActionButtonWidgetBackgroundColorKey];
+                backgroundColor = [userDefaults PDFListViewColorForKey:CAnnotationActionButtonWidgetBackgroundColorKey] ? : NSColor.grayColor;
                 break;
             case CAnnotationTypeListMenu:
-                backgroundColor = [userDefaults PDFListViewColorForKey:CAnnotationChoiceListWidgetBackgroundColorKey];
+                backgroundColor = [userDefaults PDFListViewColorForKey:CAnnotationChoiceListWidgetBackgroundColorKey] ? : NSColor.grayColor;
                 break;
             case CAnnotationTypeActionButton:
                 backgroundColor = [userDefaults PDFListViewColorForKey:CAnnotationActionButtonWidgetBackgroundColorKey];

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

@@ -3584,7 +3584,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
             if (backgroundColor) {
                 [(CPDFWidgetAnnotation *)newAnnotation setBackgroundColor:backgroundColor];
             } else {
-                [(CPDFWidgetAnnotation *)newAnnotation setBackgroundColor:[NSColor clearColor]];
+                [(CPDFWidgetAnnotation *)newAnnotation setBackgroundColor:[NSColor grayColor]];
             }
             
             NSColor* fontColor = [sud colorForKey:@"SKAnnotationChoiceWidgetFontColorKey"];
@@ -3606,7 +3606,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
             if (backgroundColor) {
                 [(CPDFWidgetAnnotation *)newAnnotation setBackgroundColor:backgroundColor];
             } else {
-                [(CPDFWidgetAnnotation *)newAnnotation setBackgroundColor:[NSColor clearColor]];
+                [(CPDFWidgetAnnotation *)newAnnotation setBackgroundColor:[NSColor grayColor]];
             }
             
             NSColor* fontColor = [sud colorForKey:@"SKAnnotationChoiceListWidgetFontColorKey"];
@@ -3655,7 +3655,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
             if (backgroundColor) {
                 [(CPDFWidgetAnnotation *)textWidget setBackgroundColor:backgroundColor];
             } else {
-                [(CPDFWidgetAnnotation *)textWidget setBackgroundColor:[NSColor whiteColor]];
+                [(CPDFWidgetAnnotation *)textWidget setBackgroundColor:[NSColor grayColor]];
             }
             
             NSColor* fontColor = [sud colorForKey:@"SKAnnotationTextWidgetFontColorKey"];