Browse Source

PDFTools(iOS)-QA_bug 编辑模块夜间模式和上下文菜单问题修改

yangliuhua 1 year ago
parent
commit
7a0d2bef86

+ 1 - 1
Edit-Ctrl-Demo/Edit-Ctrl-Demo.xcodeproj/project.pbxproj

@@ -415,7 +415,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
-				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				DEVELOPMENT_TEAM = Q43DRF894U;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = "Edit-Ctrl-Demo/Info.plist";

+ 1 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFOpacitySliderView.m

@@ -45,7 +45,7 @@
         self.startLabel.textAlignment = NSTextAlignmentCenter;
         self.startLabel.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
         self.startLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
-        self.startLabel.textColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1];
+        self.startLabel.textColor = [CPDFColorUtils CPageEditToolbarFontColor];
         [self addSubview:self.startLabel];
 
         self.sliderCount = 10;

+ 0 - 1
compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView+Edit.h

@@ -15,6 +15,5 @@
 
 @interface CPDFListView (Edit)<UINavigationControllerDelegate,UIImagePickerControllerDelegate>
 
-
 @end
 

+ 64 - 32
compdfkit-tools/compdfkit-tools/Common/Views/PDFView/PDFListView/CPDFListView+Edit.m

@@ -78,7 +78,7 @@
                 }
                 UIMenuItem * leftRotateItem = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Rotate Left", nil) action:@selector(leftRotateCropActionClick:)];
                 
-                UIMenuItem * rightRotateItem = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Rotate Right", nil) action:@selector(leftRotateCropActionClick:)];
+                UIMenuItem * rightRotateItem = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Rotate Right", nil) action:@selector(rightRotateCropActionClick:)];
                 
                 UIMenuItem * rPlaceItem  = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Replace", nil) action:@selector(replaceActionClick:)];
                 
@@ -107,39 +107,71 @@
                 if(deleteItem)
                     [menuItems addObject:deleteItem];
             }else{
-                [menuItems removeAllObjects];
-                UIMenuItem * propertyItem  = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Properties", nil) action:@selector(propertyEditingItemAction:)];
-                
-                UIMenuItem * opacityItem  = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Opacity", nil) action:@selector(opacityEditingItemAction:)];
-                
-                UIMenuItem *editItem;
-                UIMenuItem *copyItem;
-                UIMenuItem *cutItem;
-                UIMenuItem *deleteItem;
-                
-                for (UIMenuItem * item in menuItem) {
-                    if([item.title isEqualToString:NSLocalizedString(@"Edit", nil)]){
-                        editItem = item;
-                    }else if([item.title isEqualToString:NSLocalizedString(@"Copy", nil)]){
-                        copyItem = item;
-                    }else if([item.title isEqualToString:NSLocalizedString(@"Cut", nil)]){
-                        cutItem = item;
-                    }else if([item.title isEqualToString:NSLocalizedString(@"Delete", nil)]){
-                        deleteItem = item;
+                if (self.editStatus == CEditingSelectStateEditNoneText || self.editStatus == CEditingSelectStateEditSelectText) {
+                    [menuItems removeAllObjects];
+                    UIMenuItem * propertyItem  = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Properties", nil) action:@selector(propertyEditingItemAction:)];
+                    
+                    UIMenuItem * opacityItem  = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Opacity", nil) action:@selector(opacityEditingItemAction:)];
+                    
+                    UIMenuItem *editItem;
+                    UIMenuItem *copyItem;
+                    UIMenuItem *cutItem;
+                    UIMenuItem *deleteItem;
+                    
+                    for (UIMenuItem * item in menuItem) {
+                        if([item.title isEqualToString:NSLocalizedString(@"Edit", nil)]){
+                            editItem = item;
+                        }else if([item.title isEqualToString:NSLocalizedString(@"Copy", nil)]){
+                            copyItem = item;
+                        }else if([item.title isEqualToString:NSLocalizedString(@"Cut", nil)]){
+                            cutItem = item;
+                        }else if([item.title isEqualToString:NSLocalizedString(@"Delete", nil)]){
+                            deleteItem = item;
+                        }
+                    }
+                    if(propertyItem)
+                        [menuItems addObject:propertyItem];
+                    if(opacityItem)
+                        [menuItems addObject:opacityItem];
+                    if(editItem)
+                        [menuItems addObject:editItem];
+                    if(cutItem)
+                        [menuItems addObject:cutItem];
+                    if(copyItem)
+                        [menuItems addObject:copyItem];
+                    if(deleteItem)
+                        [menuItems addObject:deleteItem];
+                } else if (self.editStatus == CEditingSelectStateEditTextArea) {
+                    [menuItems removeAllObjects];
+                    UIMenuItem * propertyItem  = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Properties", nil) action:@selector(propertyEditingItemAction:)];
+                    
+                    UIMenuItem *editItem;
+                    UIMenuItem *copyItem;
+                    UIMenuItem *cutItem;
+                    UIMenuItem *deleteItem;
+                    
+                    for (UIMenuItem * item in menuItem) {
+                        if([item.title isEqualToString:NSLocalizedString(@"Edit", nil)]){
+                            editItem = item;
+                        }else if([item.title isEqualToString:NSLocalizedString(@"Copy", nil)]){
+                            copyItem = item;
+                        }else if([item.title isEqualToString:NSLocalizedString(@"Cut", nil)]){
+                            cutItem = item;
+                        }else if([item.title isEqualToString:NSLocalizedString(@"Delete", nil)]){
+                            deleteItem = item;
+                        }
                     }
+                    if(propertyItem)
+                        [menuItems addObject:propertyItem];
+                    if(editItem)
+                        [menuItems addObject:editItem];
+                    if(cutItem)
+                        [menuItems addObject:cutItem];
+                    if(copyItem)
+                        [menuItems addObject:copyItem];
+                    if(deleteItem)
+                        [menuItems addObject:deleteItem];
                 }
-                if(editItem)
-                    [menuItems addObject:editItem];
-                if(copyItem)
-                    [menuItems addObject:copyItem];
-                if(cutItem)
-                    [menuItems addObject:cutItem];
-                if(propertyItem)
-                    [menuItems addObject:propertyItem];
-                if(opacityItem)
-                    [menuItems addObject:opacityItem];
-                if(deleteItem)
-                    [menuItems addObject:deleteItem];
             }
         }
     }

+ 9 - 9
compdfkit-tools/compdfkit-tools/Edit/CPDFEditCell/CPDFImagePropertyCell.m

@@ -54,7 +54,7 @@
         self.rotateLabel = [[UILabel alloc] init];
         self.rotateLabel.font = [UIFont systemFontOfSize:13];
         self.rotateLabel.text =  NSLocalizedString(@"Rotate", nil);
-        self.rotateLabel.textColor = [UIColor colorWithRed:153./255 green:153./255 blue:153./255 alpha:1.];
+        self.rotateLabel.textColor = [CPDFColorUtils CPageEditToolbarFontColor];
         [self.contentView addSubview:self.rotateLabel];
         
         
@@ -63,7 +63,7 @@
         [self.leftRotateBtn setImage:[UIImage imageNamed:@"CPDFEditIRotate" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
         NSString * leftTitle = [NSString stringWithFormat:@" %@",NSLocalizedString(@"Rotate Left", nil)];
         [self.leftRotateBtn setTitle:leftTitle forState:UIControlStateNormal];
-        [self.leftRotateBtn setTitleColor:[UIColor colorWithRed:67/255. green:71/255. blue:77/255. alpha:1.] forState:UIControlStateNormal];
+        [self.leftRotateBtn setTitleColor:[CPDFColorUtils CPageEditToolbarFontColor] forState:UIControlStateNormal];
         self.leftRotateBtn.titleLabel.font = [UIFont systemFontOfSize:14.];
         self.leftRotateBtn.layer.borderWidth = 1.;
         self.leftRotateBtn.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
@@ -75,7 +75,7 @@
         [self.rightRotateBtn setImage:[UIImage imageNamed:@"CPDFEditRRotate" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
         NSString * rightTitle = [NSString stringWithFormat:@" %@",NSLocalizedString(@"Rotate Right", nil)];
         [self.rightRotateBtn setTitle:rightTitle forState:UIControlStateNormal];
-        [self.rightRotateBtn setTitleColor:[UIColor colorWithRed:67/255. green:71/255. blue:77/255. alpha:1.] forState:UIControlStateNormal];
+        [self.rightRotateBtn setTitleColor:[CPDFColorUtils CPageEditToolbarFontColor] forState:UIControlStateNormal];
         self.rightRotateBtn.titleLabel.font = [UIFont systemFontOfSize:14.];
         self.rightRotateBtn.layer.borderWidth = 1.;
         self.rightRotateBtn.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
@@ -86,7 +86,7 @@
         self.transformLabel = [[UILabel alloc] init];
         self.transformLabel.font = [UIFont systemFontOfSize:13];
         self.transformLabel.text =  NSLocalizedString(@"Flip", nil);
-        self.transformLabel.textColor = [UIColor colorWithRed:153./255 green:153./255 blue:153./255 alpha:1.];
+        self.transformLabel.textColor = [CPDFColorUtils CPageEditToolbarFontColor];
         [self.contentView addSubview:self.transformLabel];
         
         self.transformView = [[UIView alloc] init];
@@ -111,7 +111,7 @@
         self.opacityView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
         self.opacityView.titleLabel.text = NSLocalizedString(@"Opacity", nil);
         self.opacityView.titleLabel.font = [UIFont systemFontOfSize:13];
-        self.opacityView.titleLabel.textColor = [UIColor colorWithRed:153./255 green:153./255 blue:153./255 alpha:1.];
+        self.opacityView.titleLabel.textColor = [CPDFColorUtils CPageEditToolbarFontColor];
         self.opacityView.startLabel.text = @"0";
         self.opacityView.defaultValue = 1;
         self.opacityView.bgColor = [UIColor clearColor];
@@ -121,7 +121,7 @@
         self.toolsLabel = [[UILabel alloc] init];
         self.toolsLabel.font = [UIFont systemFontOfSize:13];
         self.toolsLabel.text =  NSLocalizedString(@"Tools", nil);
-        self.toolsLabel.textColor = [UIColor colorWithRed:153./255 green:153./255 blue:153./255 alpha:1.];
+        self.toolsLabel.textColor = [CPDFColorUtils CPageEditToolbarFontColor];
         [self.contentView addSubview:self.toolsLabel];
         
         
@@ -130,7 +130,7 @@
         [self.replaceBtn setImage:[UIImage imageNamed:@"CPDFEditReplace" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
         NSString * replaceTitle = [NSString stringWithFormat:@" %@",NSLocalizedString(@"Replace", nil)];
         [self.replaceBtn setTitle:replaceTitle forState:UIControlStateNormal];
-        [self.replaceBtn setTitleColor: [UIColor colorWithRed:67/255. green:71/255. blue:77/255. alpha:1.] forState:UIControlStateNormal];
+        [self.replaceBtn setTitleColor: [CPDFColorUtils CPageEditToolbarFontColor] forState:UIControlStateNormal];
         self.replaceBtn.titleLabel.font  = [UIFont systemFontOfSize:14.f];
         self.replaceBtn.layer.borderWidth = 1;
         self.replaceBtn.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
@@ -143,7 +143,7 @@
         [self.exportBtn setImage:[UIImage imageNamed:@"CPDFEditExport" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
         NSString * exportTitle = [NSString stringWithFormat:@" %@",NSLocalizedString(@"Export", nil)];
         [self.exportBtn setTitle:exportTitle forState:UIControlStateNormal];
-        [self.exportBtn setTitleColor: [UIColor colorWithRed:67/255. green:71/255. blue:77/255. alpha:1.] forState:UIControlStateNormal];
+        [self.exportBtn setTitleColor: [CPDFColorUtils CPageEditToolbarFontColor] forState:UIControlStateNormal];
         self.exportBtn.titleLabel.font  = [UIFont systemFontOfSize:14.f];
         self.exportBtn.layer.borderWidth = 1;
         self.exportBtn.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
@@ -156,7 +156,7 @@
         [self.cropBtn setImage:[UIImage imageNamed:@"CPDFEditCrop" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
         NSString * cropTitle = [NSString stringWithFormat:@" %@",NSLocalizedString(@"Crop", nil)];
         [self.cropBtn setTitle:cropTitle forState:UIControlStateNormal];
-        [self.cropBtn setTitleColor: [UIColor colorWithRed:67/255. green:71/255. blue:77/255. alpha:1.] forState:UIControlStateNormal];
+        [self.cropBtn setTitleColor: [CPDFColorUtils CPageEditToolbarFontColor] forState:UIControlStateNormal];
         self.cropBtn.titleLabel.font  = [UIFont systemFontOfSize:14.f];
         self.cropBtn.layer.borderWidth = 1;
         self.cropBtn.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;

+ 1 - 1
compdfkit-tools/compdfkit-tools/Edit/CPDFEditCell/CPDFTextPropertyCell.m

@@ -159,7 +159,7 @@
         
         self.fontNameSelectLabel = [[UILabel alloc] init];
         self.fontNameSelectLabel.adjustsFontSizeToFitWidth = YES;
-        self.fontNameSelectLabel.textColor = [UIColor blackColor];
+        self.fontNameSelectLabel.textColor = [CPDFColorUtils CPageEditToolbarFontColor];
         [self.dropMenuView addSubview:self.fontNameSelectLabel];
         
         self.fontSelectBtn = [UIButton buttonWithType:UIButtonTypeCustom];

+ 5 - 1
compdfkit-tools/compdfkit-tools/PageEdit/Control/CPDFPDFInsertViewController.m

@@ -277,7 +277,11 @@
             if (![self.pageLoactionBtns containsObject:cell.locationSelectBtn]) {
                 [self.pageLoactionBtns addObject:cell.locationSelectBtn];
             }
-            cell.locationSelectBtn.selected = YES;
+            if (self.currentPageIndex) {
+                self.locationPreCell = cell;
+                cell.locationSelectBtn.selected = !cell.locationSelectBtn.selected;
+                cell.locationSelectLabel.textColor = [CPDFColorUtils CPageEditToolbarFontColor];
+            }
             cell.separatorInset = UIEdgeInsetsMake(0, self.view.bounds.size.width, 0, 0);
         }
             break;

+ 2 - 2
viewer-ctrl-demo/viewer-ctrl-demo.xcodeproj/project.pbxproj

@@ -364,7 +364,7 @@
 				CODE_SIGN_ENTITLEMENTS = "viewer-ctrl-demo/viewer-ctrl-demo.entitlements";
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
-				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				DEVELOPMENT_TEAM = Q43DRF894U;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				HEADER_SEARCH_PATHS = "";
@@ -395,7 +395,7 @@
 				CODE_SIGN_ENTITLEMENTS = "viewer-ctrl-demo/viewer-ctrl-demo.entitlements";
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
-				DEVELOPMENT_TEAM = 4GGQPGRTSV;
+				DEVELOPMENT_TEAM = Q43DRF894U;
 				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
 				GENERATE_INFOPLIST_FILE = YES;
 				HEADER_SEARCH_PATHS = "";