Procházet zdrojové kódy

ComPDFKit(iOS) - 背景颜色新方案处理

chenyu před 1 rokem
rodič
revize
c93681f586

+ 10 - 4
ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormProperties/Controller/CPDFFormButtonViewController.m

@@ -131,11 +131,9 @@
     self.textFiledView.contentField.text = self.buttonWidget.fieldName;
     self.buttonTextFiledView.contentField.text = self.buttonWidget.caption;
     
-    //border color
-    self.backGroundColorView.selectedColor = self.buttonWidget.backgroundColor;
-    
     if(self.buttonWidget.borderColor == nil) {
-        self.borderColorView.selectedColor = [UIColor blackColor];
+        self.borderColorView.selectedColor = [UIColor clearColor];
+        self.buttonWidget.borderColor = self.borderColorView.selectedColor;
         [self refreshUI];
     }else{
         self.borderColorView.selectedColor = self.buttonWidget.borderColor;
@@ -148,6 +146,14 @@
     }else{
         self.textColorView.selectedColor = self.buttonWidget.fontColor;
     }
+    
+    if(self.buttonWidget.backgroundColor == nil) {
+        self.backGroundColorView.selectedColor = [UIColor clearColor];
+        self.buttonWidget.backgroundColor = self.backGroundColorView.selectedColor;
+        [self refreshUI];
+    }else{
+        self.backGroundColorView.selectedColor = self.buttonWidget.backgroundColor;
+    }
 
     
     //Text content

+ 8 - 2
ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormProperties/Controller/CPDFFormCheckBoxViewController.m

@@ -135,14 +135,20 @@
     }
     
     if(self.buttonWidget.borderColor == nil){
-        self.borderColorView.selectedColor = [UIColor blackColor];
+        self.borderColorView.selectedColor = [UIColor clearColor];
         self.buttonWidget.borderColor = self.borderColorView.selectedColor;
         [self refreshUI];
     }else{
         self.borderColorView.selectedColor = self.buttonWidget.borderColor;
     }
     
-    self.backGroundColorView.selectedColor = self.buttonWidget.backgroundColor;
+    if(self.backGroundColorView.selectedColor == nil) {
+        self.backGroundColorView.selectedColor = [UIColor clearColor];
+        self.buttonWidget.backgroundColor = self.backGroundColorView.selectedColor;
+        [self refreshUI];
+    }else{
+        self.backGroundColorView.selectedColor = self.buttonWidget.backgroundColor;
+    }
     
     
     switch (buttonWidget.widgetCheckStyle) {

+ 25 - 5
ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormProperties/Controller/CPDFFormComboxViewController.m

@@ -123,12 +123,32 @@
     //field Name
     self.textFiledView.contentField.text = self.comboxChoiceWidget.fieldName;
     //border color
-    self.borderColorView.selectedColor = self.comboxChoiceWidget.borderColor;
-    //back groundColor
-    self.backGroundColorView.selectedColor = self.comboxChoiceWidget.backgroundColor;
-    //Text color
-    self.textColorView.selectedColor = self.comboxChoiceWidget.fontColor;
+    if(self.comboxChoiceWidget.borderColor == nil) {
+        self.borderColorView.selectedColor = [UIColor clearColor];
+        self.comboxChoiceWidget.borderColor = self.borderColorView.selectedColor;
+        [self refreshUI];
+    }else{
+        self.borderColorView.selectedColor = self.comboxChoiceWidget.borderColor;
+    }
+    
+    if(self.comboxChoiceWidget.backgroundColor == nil) {
+        self.backGroundColorView.selectedColor = [UIColor clearColor];
+        self.comboxChoiceWidget.backgroundColor = self.backGroundColorView.selectedColor;
+        [self refreshUI];
+    }else {
+        //back groundColor
+        self.backGroundColorView.selectedColor = self.comboxChoiceWidget.backgroundColor;
+    }
     
+    if(self.comboxChoiceWidget.fontColor == nil) {
+        self.textColorView.selectedColor = [UIColor blackColor];
+        self.comboxChoiceWidget.fontColor = self.textColorView.selectedColor;
+        [self refreshUI];
+    }else {
+        //Text color
+        self.textColorView.selectedColor = self.comboxChoiceWidget.fontColor;
+    }
+
     //Text content
     [self analyzeFont:self.comboxChoiceWidget.font.fontName];
     

+ 23 - 4
ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormProperties/Controller/CPDFFormListViewController.m

@@ -195,12 +195,31 @@
     //field Name
     self.textFiledView.contentField.text = self.listChoiceWidget.fieldName;
     //border color
-    self.borderColorView.selectedColor = self.listChoiceWidget.borderColor;
-    //back groundColor
-    self.backGroundColorView.selectedColor = self.listChoiceWidget.backgroundColor;
+    if(self.listChoiceWidget.borderColor == nil) {
+        self.borderColorView.selectedColor = [UIColor clearColor];
+        self.listChoiceWidget.borderColor = self.borderColorView.selectedColor;
+        [self refreshUI];
+    }else{
+        self.borderColorView.selectedColor = self.listChoiceWidget.borderColor;
+    }
+    
+    
+    if(self.listChoiceWidget.backgroundColor == nil) {
+        self.backGroundColorView.selectedColor = [UIColor clearColor];
+        self.listChoiceWidget.backgroundColor = self.backGroundColorView.selectedColor;
+        [self refreshUI];
+    }else {
+        //back groundColor
+        self.backGroundColorView.selectedColor = self.listChoiceWidget.backgroundColor;
+    }
     
     //Text color
-    self.textColorView.selectedColor = self.listChoiceWidget.fontColor;
+    if(self.listChoiceWidget.fontColor == nil) {
+        self.textColorView.selectedColor = [UIColor blackColor];
+        self.listChoiceWidget.fontColor = self.textColorView.selectedColor;
+    }else{
+        self.textColorView.selectedColor = self.listChoiceWidget.fontColor;
+    }
     
     //Text content
     [self analyzeFont:self.listChoiceWidget.font.fontName];

+ 9 - 3
ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormProperties/Controller/CPDFFormRadioButtonViewController.m

@@ -114,19 +114,25 @@
     self.formTextFiledView.contentField.text = self.buttonWidget.fieldName;
     
     if(self.buttonWidget.borderColor == nil){
-        self.borderColorView.selectedColor = [UIColor blackColor];
+        self.borderColorView.selectedColor = [UIColor clearColor];
         self.buttonWidget.borderColor = self.borderColorView.selectedColor;
         [self refreshUI];
     }else{
         self.borderColorView.selectedColor = self.buttonWidget.borderColor;
     }
     
-    self.backGroundColorView.selectedColor = self.buttonWidget.backgroundColor;
+    if(self.buttonWidget.backgroundColor == nil) {
+        self.backGroundColorView.selectedColor = [UIColor clearColor];
+        self.buttonWidget.backgroundColor = self.backGroundColorView.selectedColor;
+        [self refreshUI];
+    }else{
+        self.backGroundColorView.selectedColor = self.buttonWidget.backgroundColor;
+    }
     
     
     if(self.buttonWidget.fontColor == nil) {
         self.colorSelectView.selectedColor = [UIColor blackColor];
-        self.buttonWidget.fontColor = [UIColor blackColor];
+        self.buttonWidget.fontColor = self.colorSelectView.selectedColor;
         [self refreshUI];
     }else{
         self.colorSelectView.selectedColor = self.buttonWidget.fontColor;

+ 24 - 4
ComPDFKit_Tools/ComPDFKit_Tools/Forms/PDFFormProperties/Controller/CPDFFormTextViewController.m

@@ -144,12 +144,32 @@
     //alignment
     self.fontAlignView.alignment = self.textWidget.alignment;
     //border color
-    self.borderColorView.selectedColor = self.textWidget.borderColor;
+    if(self.textWidget.borderColor == nil) {
+        self.borderColorView.selectedColor = [UIColor clearColor];
+        self.textWidget.borderColor = self.borderColorView.selectedColor;
+        [self refreshUI];
+    }else{
+        self.borderColorView.selectedColor = self.textWidget.borderColor;
+    }
+
     //back groundColor
-    self.backGroundColorView.selectedColor = self.textWidget.backgroundColor;
-    //Text color
-    self.textColorView.selectedColor = self.textWidget.fontColor;
+    if(textWidget.backgroundColor == nil) {
+        self.backGroundColorView.selectedColor = [UIColor clearColor];
+        self.textWidget.backgroundColor = self.backGroundColorView.selectedColor;
+        [self refreshUI];
+    }else {
+        self.backGroundColorView.selectedColor = self.textWidget.backgroundColor;
+    }
     
+    if(self.textWidget.fontColor == nil) {
+        self.textColorView.selectedColor = [UIColor blackColor];
+        self.textWidget.fontColor = self.textColorView.selectedColor;
+        [self refreshUI];
+    }else{
+        //Text color
+        self.textColorView.selectedColor = self.textWidget.fontColor;
+    }
+
     
     //Text content
     [self analyzeFont:self.textWidget.font.fontName];