Browse Source

综合 - 调整barUI

dinglingui 1 year ago
parent
commit
6d12c21d6a

+ 10 - 4
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/CPDFAnnotationBar.m

@@ -78,7 +78,7 @@
     if (self = [super init]) {
         self.annotManage = annotationManage;
         
-        self.backgroundColor = [CPDFColorUtils CAnnotationBarNoSelectBackgroundColor];
+        self.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
         
         UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 1)];
         line.backgroundColor = [UIColor colorWithRed:210.0/255.0 green:210.0/255.0 blue:210.0/255.0 alpha:1.0];
@@ -267,9 +267,15 @@
     [self addSubview:self.propertiesBar];
     
     UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(offset, 12, 1, 20)];
-    lineView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1];
-    
-    [self.propertiesBar addSubview:lineView];
+    if (@available(iOS 13.0, *)){
+        if([UITraitCollection currentTraitCollection].userInterfaceStyle == UIUserInterfaceStyleDark)
+            lineView.backgroundColor = [UIColor whiteColor];
+        else
+            lineView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1];
+    } else
+        lineView.backgroundColor = [UIColor blackColor];
+
+        [self.propertiesBar addSubview:lineView];
     offset += lineView.frame.size.width;
     
     _propertiesBtn = [[UIButton alloc] initWithFrame:CGRectMake(offset, topOffset, buttonSize, buttonSize)];

+ 31 - 26
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageRedo.imageset/redo 1.pdf

@@ -10,26 +10,31 @@ stream
 /DeviceRGB CS
 /DeviceRGB cs
 q
--1.000000 -0.000000 -0.000000 1.000000 19.000000 2.528687 cm
+-1.000000 -0.000000 -0.000000 1.000000 19.332031 5.283569 cm
 1.000000 1.000000 1.000000 scn
-0.530330 10.632927 m
-0.000000 10.102597 l
-0.530330 9.572268 l
-5.368716 4.733881 l
-6.429376 5.794541 l
-2.871321 9.352596 l
-12.020658 9.352596 l
-14.189099 9.352596 15.946970 7.594728 15.946970 5.426288 c
-15.946970 3.257847 14.189101 1.499979 12.020661 1.499979 c
-2.000000 1.499979 l
-2.000000 -0.000021 l
-12.020661 -0.000021 l
-15.017529 -0.000021 17.446970 2.429420 17.446970 5.426288 c
-17.446970 8.423156 15.017525 10.852596 12.020658 10.852596 c
-2.871319 10.852596 l
-6.429376 14.410653 l
-5.368716 15.471313 l
-0.530330 10.632927 l
+0.530323 9.390043 m
+0.000000 8.859706 l
+0.530323 8.329369 l
+4.725613 4.133963 l
+5.786258 5.194637 l
+2.871189 8.109787 l
+10.907884 8.109787 l
+12.733111 8.109787 14.212748 6.630149 14.212748 4.804920 c
+14.212748 2.979692 12.733108 1.500053 10.907879 1.500053 c
+2.219233 1.500053 l
+2.219233 0.000053 l
+10.907879 0.000053 l
+13.561534 0.000053 15.712748 2.151264 15.712748 4.804920 c
+15.712748 7.458575 13.561540 9.609787 10.907884 9.609787 c
+2.871352 9.609787 l
+5.786258 12.524775 l
+4.725613 13.585449 l
+0.530323 9.390043 l
+h
+2.219233 8.957650 m
+2.121291 8.859706 l
+2.219233 8.761762 l
+2.219233 8.957650 l
 h
 f*
 n
@@ -39,13 +44,13 @@ endstream
 endobj
 
 3 0 obj
-  660
+  733
 endobj
 
 4 0 obj
   << /Annots []
      /Type /Page
-     /MediaBox [ 0.000000 0.000000 20.000000 20.000000 ]
+     /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ]
      /Resources 1 0 R
      /Contents 2 0 R
      /Parent 5 0 R
@@ -70,15 +75,15 @@ xref
 0000000000 65535 f
 0000000010 00000 n
 0000000034 00000 n
-0000000750 00000 n
-0000000772 00000 n
-0000000945 00000 n
-0000001019 00000 n
+0000000823 00000 n
+0000000845 00000 n
+0000001018 00000 n
+0000001092 00000 n
 trailer
 << /ID [ (some) (id) ]
    /Root 6 0 R
    /Size 7
 >>
 startxref
-1078
+1151
 %%EOF

+ 25 - 25
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageRedo.imageset/redo.pdf

@@ -10,26 +10,26 @@ stream
 /DeviceRGB CS
 /DeviceRGB cs
 q
--1.000000 -0.000000 -0.000000 1.000000 16.810547 4.098362 cm
+-1.000000 -0.000000 -0.000000 1.000000 18.750000 2.528666 cm
 0.262745 0.278431 0.301961 scn
-0.530330 8.280331 m
-0.000000 7.750000 l
-0.530330 7.219670 l
-4.151638 3.598363 l
-5.212297 4.659023 l
-2.871320 7.000000 l
-9.560660 7.000000 l
-11.079443 7.000000 12.310660 5.768784 12.310660 4.250000 c
-12.310660 2.731217 11.079443 1.500000 9.560660 1.500000 c
-2.060660 1.500000 l
-2.060660 0.000000 l
-9.560660 0.000000 l
-11.907870 0.000000 13.810660 1.902790 13.810660 4.250000 c
-13.810660 6.597211 11.907870 8.500000 9.560660 8.500000 c
-2.871320 8.500000 l
-5.212297 10.840978 l
-4.151638 11.901638 l
-0.530330 8.280331 l
+0.530330 10.632948 m
+0.000000 10.102618 l
+0.530330 9.572289 l
+5.368716 4.733902 l
+6.429376 5.794562 l
+2.871321 9.352617 l
+11.323880 9.352617 l
+13.492322 9.352617 15.250193 7.594748 15.250193 5.426309 c
+15.250193 3.257868 13.492324 1.500000 11.323884 1.500000 c
+1.303223 1.500000 l
+1.303223 0.000000 l
+11.323884 0.000000 l
+14.320751 0.000000 16.750193 2.429441 16.750193 5.426309 c
+16.750193 8.423177 14.320747 10.852617 11.323880 10.852617 c
+2.871319 10.852617 l
+6.429376 14.410674 l
+5.368716 15.471334 l
+0.530330 10.632948 l
 h
 f*
 n
@@ -39,7 +39,7 @@ endstream
 endobj
 
 3 0 obj
-  647
+  657
 endobj
 
 4 0 obj
@@ -70,15 +70,15 @@ xref
 0000000000 65535 f
 0000000010 00000 n
 0000000034 00000 n
-0000000737 00000 n
-0000000759 00000 n
-0000000932 00000 n
-0000001006 00000 n
+0000000747 00000 n
+0000000769 00000 n
+0000000942 00000 n
+0000001016 00000 n
 trailer
 << /ID [ (some) (id) ]
    /Root 6 0 R
    /Size 7
 >>
 startxref
-1065
+1075
 %%EOF

+ 31 - 26
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUndo.imageset/undo 1.pdf

@@ -10,26 +10,31 @@ stream
 /DeviceRGB CS
 /DeviceRGB cs
 q
-1.000000 0.000000 -0.000000 1.000000 1.000000 2.528687 cm
+1.000000 0.000000 -0.000000 1.000000 4.667969 5.283569 cm
 1.000000 1.000000 1.000000 scn
-0.530330 10.632927 m
-0.000000 10.102597 l
-0.530330 9.572268 l
-5.368716 4.733881 l
-6.429376 5.794541 l
-2.871321 9.352596 l
-12.020658 9.352596 l
-14.189099 9.352596 15.946970 7.594728 15.946970 5.426288 c
-15.946970 3.257847 14.189101 1.499979 12.020661 1.499979 c
-2.000000 1.499979 l
-2.000000 -0.000021 l
-12.020661 -0.000021 l
-15.017529 -0.000021 17.446970 2.429420 17.446970 5.426288 c
-17.446970 8.423156 15.017525 10.852596 12.020658 10.852596 c
-2.871319 10.852596 l
-6.429376 14.410653 l
-5.368716 15.471313 l
-0.530330 10.632927 l
+0.530323 9.390043 m
+0.000000 8.859706 l
+0.530323 8.329369 l
+4.725613 4.133964 l
+5.786258 5.194638 l
+2.871189 8.109787 l
+10.907884 8.109787 l
+12.733111 8.109787 14.212748 6.630149 14.212748 4.804920 c
+14.212748 2.979692 12.733108 1.500053 10.907879 1.500053 c
+2.219233 1.500053 l
+2.219233 0.000053 l
+10.907879 0.000053 l
+13.561534 0.000053 15.712748 2.151264 15.712748 4.804920 c
+15.712748 7.458575 13.561540 9.609787 10.907884 9.609787 c
+2.871352 9.609787 l
+5.786258 12.524775 l
+4.725613 13.585449 l
+0.530323 9.390043 l
+h
+2.219233 8.957650 m
+2.121291 8.859706 l
+2.219233 8.761762 l
+2.219233 8.957650 l
 h
 f*
 n
@@ -39,13 +44,13 @@ endstream
 endobj
 
 3 0 obj
-  657
+  730
 endobj
 
 4 0 obj
   << /Annots []
      /Type /Page
-     /MediaBox [ 0.000000 0.000000 20.000000 20.000000 ]
+     /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ]
      /Resources 1 0 R
      /Contents 2 0 R
      /Parent 5 0 R
@@ -70,15 +75,15 @@ xref
 0000000000 65535 f
 0000000010 00000 n
 0000000034 00000 n
-0000000747 00000 n
-0000000769 00000 n
-0000000942 00000 n
-0000001016 00000 n
+0000000820 00000 n
+0000000842 00000 n
+0000001015 00000 n
+0000001089 00000 n
 trailer
 << /ID [ (some) (id) ]
    /Root 6 0 R
    /Size 7
 >>
 startxref
-1075
+1148
 %%EOF

+ 25 - 25
compdfkit-tools/compdfkit-tools/Common/Views/PDFAnnotationBar/Image.xcassets/CPDFAnnotationBarImageUndo.imageset/undo.pdf

@@ -10,26 +10,26 @@ stream
 /DeviceRGB CS
 /DeviceRGB cs
 q
-1.000000 0.000000 -0.000000 1.000000 3.000000 4.098362 cm
+1.000000 0.000000 -0.000000 1.000000 1.250000 2.528666 cm
 0.262745 0.278431 0.301961 scn
-0.530330 8.280331 m
-0.000000 7.750000 l
-0.530330 7.219670 l
-4.151638 3.598363 l
-5.212297 4.659023 l
-2.871320 7.000000 l
-9.560660 7.000000 l
-11.079443 7.000000 12.310660 5.768784 12.310660 4.250000 c
-12.310660 2.731217 11.079443 1.500000 9.560660 1.500000 c
-2.060660 1.500000 l
-2.060660 0.000000 l
-9.560660 0.000000 l
-11.907870 0.000000 13.810660 1.902790 13.810660 4.250000 c
-13.810660 6.597211 11.907870 8.500000 9.560660 8.500000 c
-2.871320 8.500000 l
-5.212297 10.840978 l
-4.151638 11.901638 l
-0.530330 8.280331 l
+0.530330 10.632948 m
+0.000000 10.102618 l
+0.530330 9.572289 l
+5.368716 4.733902 l
+6.429376 5.794562 l
+2.871321 9.352617 l
+11.323880 9.352617 l
+13.492322 9.352617 15.250193 7.594748 15.250193 5.426309 c
+15.250193 3.257868 13.492324 1.500000 11.323884 1.500000 c
+1.303223 1.500000 l
+1.303223 0.000000 l
+11.323884 0.000000 l
+14.320751 0.000000 16.750193 2.429441 16.750193 5.426309 c
+16.750193 8.423177 14.320747 10.852617 11.323880 10.852617 c
+2.871319 10.852617 l
+6.429376 14.410674 l
+5.368716 15.471334 l
+0.530330 10.632948 l
 h
 f*
 n
@@ -39,7 +39,7 @@ endstream
 endobj
 
 3 0 obj
-  644
+  654
 endobj
 
 4 0 obj
@@ -70,15 +70,15 @@ xref
 0000000000 65535 f
 0000000010 00000 n
 0000000034 00000 n
-0000000734 00000 n
-0000000756 00000 n
-0000000929 00000 n
-0000001003 00000 n
+0000000744 00000 n
+0000000766 00000 n
+0000000939 00000 n
+0000001013 00000 n
 trailer
 << /ID [ (some) (id) ]
    /Root 6 0 R
    /Size 7
 >>
 startxref
-1062
+1072
 %%EOF

+ 23 - 21
compdfkit-tools/compdfkit-tools/Edit/CPDFEditToolBar/CPDFEditToolBar.m

@@ -56,21 +56,15 @@
 }
 
 - (void)setUp {
-    
-    self.textEditButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    [self.textEditButton sizeToFit];
+    self.textEditButton = [[UIButton alloc] initWithFrame:CGRectMake(10, 7, 30, 30)];
     [self.textEditButton addTarget:self action:@selector(textEditAction:) forControlEvents:UIControlEventTouchUpInside];
-    self.textEditButton.frame = CGRectMake(10, 7, self.textEditButton.frame.size.width  + 10, 30);
     [self.textEditButton setImage:[UIImage imageNamed:@"CPDFEditAddText" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
 
-    
-    self.imageEditButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    [self.imageEditButton sizeToFit];
-    [self.imageEditButton addTarget:self action:@selector(imageEditAction:) forControlEvents:UIControlEventTouchUpInside];
-    self.imageEditButton.frame = CGRectMake(CGRectGetMaxX(self.textEditButton.frame) + 10, 7, self.imageEditButton.frame.size.width  + 10, 30);
+    self.imageEditButton = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.textEditButton.frame) + 10, 7, 30, 30)];
+     [self.imageEditButton addTarget:self action:@selector(imageEditAction:) forControlEvents:UIControlEventTouchUpInside];
     [self.imageEditButton setImage:[UIImage imageNamed:@"CPDFEditAddImage" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
     
-    self.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0,self.bounds.size.width - 160, 44)];
+    self.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0,self.bounds.size.width - 110, 44)];
     [self addSubview:self.leftView];
     [self.leftView addSubview:self.textEditButton];
     [self.leftView addSubview:self.imageEditButton];
@@ -79,28 +73,36 @@
     self.textEditButton.frame = CGRectMake(CGRectGetMidX(self.leftView.frame) - 50, self.textEditButton.frame.origin.y, self.textEditButton.frame.size.width, self.textEditButton.frame.size.height);
     self.imageEditButton.frame = CGRectMake(CGRectGetMidX(self.leftView.frame) + 20, self.imageEditButton.frame.origin.y, self.imageEditButton.frame.size.width, self.imageEditButton.frame.size.height);
     
-    self.propertyButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    [self.propertyButton setBackgroundImage:[UIImage imageNamed:@"CPDFEditUnorderedList" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
-    self.propertyButton.frame = CGRectMake(20, 12, 20, 20);
+    UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(19, 12, 1, 20)];
+    if (@available(iOS 13.0, *)){
+        if([UITraitCollection currentTraitCollection].userInterfaceStyle == UIUserInterfaceStyleDark)
+            lineView.backgroundColor = [UIColor whiteColor];
+        else
+            lineView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1];
+    } else
+        lineView.backgroundColor = [UIColor blackColor];
+    
+    self.propertyButton = [[UIButton alloc] initWithFrame:CGRectMake(20, 7, 30, 30)];
+    [self.propertyButton setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageProperties" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    self.propertyButton.frame = CGRectMake(20, 7, 30, 30);
     [self.propertyButton addTarget:self action:@selector(propertyAction:) forControlEvents:UIControlEventTouchUpInside];
     
-    self.undoButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    self.undoButton.frame = CGRectMake(CGRectGetMaxX(self.propertyButton.frame) + 25, 12, 20, 20);
+    self.undoButton = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.propertyButton.frame), 7, 30, 30)];
     [self.undoButton addTarget:self action:@selector(undoAction:) forControlEvents:UIControlEventTouchUpInside];
-    [self.undoButton setBackgroundImage:[UIImage imageNamed:@"CPDFEditUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.undoButton setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
     
-    self.redoButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    self.redoButton.frame = CGRectMake(CGRectGetMaxX(self.undoButton.frame) + 25, 12,20, 20);
+    self.redoButton = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.undoButton.frame), 7,30, 30)];
     [self.redoButton addTarget:self action:@selector(redoAction:) forControlEvents:UIControlEventTouchUpInside];
-    [self.redoButton setBackgroundImage:[UIImage imageNamed:@"CPDFEditRedo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
+    [self.redoButton setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageRedo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
     
-    self.rightView = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.leftView.frame), 0, 160, 60)];
+    self.rightView = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.leftView.frame), 0, 110, 44)];
     [self addSubview:self.self.rightView];
     
     [self.rightView addSubview:self.redoButton];
     [self.rightView addSubview:self.undoButton];
     [self.rightView addSubview:self.propertyButton];
-    
+    [self.rightView addSubview:lineView];
+
     self.backgroundColor = [UIColor colorWithRed:0.98 green:0.99 blue:1.0 alpha:1.0];
     
     self.splitView = [[UIView alloc] initWithFrame:CGRectMake(self.leftView.bounds.size.width-1, 12, 1, 20)];

+ 1 - 1
compdfkit-tools/compdfkit-tools/Form/View/CPDFFormBar.m

@@ -199,7 +199,7 @@
     
     CGFloat offset = 10;
 
-    CGFloat prWidth = buttonSize * 3 + offset;
+    CGFloat prWidth = buttonSize * 2 + offset;
     _propertiesBar = [[UIView alloc] initWithFrame:CGRectMake(self.bounds.size.width - prWidth, 0, prWidth, 44)];
     _propertiesBar.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
     [self addSubview:self.propertiesBar];

+ 1 - 1
compdfkit-tools/compdfkit-tools/PageEdit/Views/CPageEditToolBar.m

@@ -40,7 +40,7 @@
 
 - (instancetype)initWithFrame:(CGRect)frame {
     if (self = [super initWithFrame:frame]) {
-        self.backgroundColor = [CPDFColorUtils CAnnotationBarNoSelectBackgroundColor];
+        self.backgroundColor = [CPDFColorUtils CPDFViewControllerBackgroundColor];
         
         UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 1)];
         line.backgroundColor = [UIColor colorWithRed:210.0/255.0 green:210.0/255.0 blue:210.0/255.0 alpha:1.0];