Browse Source

【注释】修复Form注释文本框、列表框、下拉菜单创建的默认值

wanjun 10 months ago
parent
commit
508dfefa96

+ 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"];