Browse Source

PDFTools(iOS) - 刷新undo redo状态

chenyu 1 year ago
parent
commit
4ca08ea11b

+ 2 - 0
compdfkit-tools/compdfkit-tools/Common/Controls/PDFViewController/CPDFViewBaseController.m

@@ -12,6 +12,7 @@
 
 #import "CPDFViewBaseController.h"
 #import "CDocumentPasswordViewController.h"
+#import "CPDFListView+UndoManager.h"
 
 #import <ComPDFKit/ComPDFKit.h>
 #import <compdfkit_tools/compdfkit_tools.h>
@@ -506,6 +507,7 @@
                 } else {
                     [self.pdfListView updateActiveAnnotations:[NSMutableArray array]];
                     self.pdfListView.document = document;
+                    [self.pdfListView registerAsObserver];
                     [self selectDocumentRefresh];
                 }
                 

+ 2 - 0
compdfkit-tools/compdfkit-tools/Common/Views/PDFProperties/CPDFColorSelectView.m

@@ -28,6 +28,7 @@
 
 - (instancetype)initWithFrame:(CGRect)frame {
     if (self = [super initWithFrame:frame]) {
+        
         self.colorLabel = [[UILabel alloc] init];
         self.colorLabel.text = NSLocalizedString(@"Color", nil);
         self.colorLabel.textColor = [UIColor grayColor];
@@ -42,6 +43,7 @@
         
         [self addSubview:self.colorPickerView];
         self.backgroundColor = [CPDFColorUtils CAnnotationSampleBackgoundColor];
+        
     }
     return self;
 }

+ 1 - 0
compdfkit-tools/compdfkit-tools/Form/View/CPDFFormBar.h

@@ -47,5 +47,6 @@ typedef NS_ENUM(NSInteger, CPDFFormToolbarSelectedIndex) {
 - (void)buttonItemClicked_open:(UIButton *)button;
 - (void)buttonItemClicked_openOption:(UIButton *)button;
 - (void)updateStatus;
+- (void)initUndoRedo;
 
 @end

+ 5 - 0
compdfkit-tools/compdfkit-tools/Form/View/CPDFFormBar.m

@@ -277,6 +277,11 @@
     [self reloadData];
 }
 
+- (void)initUndoRedo {
+    self.undoBtn.enabled = NO;
+    self.redoBtn.enabled = NO;
+}
+
 
 - (void)buttonItemClicked_open:(UIButton *)button {
     CAnnotStyle *annotStytle = self.annotManage.annotStyle;