Browse Source

Merge branch 'develop_PDFReaderProNew' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProNew

tangchao 10 months ago
parent
commit
fd66bcb04f

+ 13 - 7
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift

@@ -128,19 +128,25 @@ import Cocoa
     }
     
     override func windowShouldClose(_ sender: NSWindow) -> Bool {
-#if DEBUG
-        if self.browser.tabStripModel.count() > 1 {
-            self.browser.windowDidBeginToClose()
-            return false
-        }
-#else
+//#if DEBUG
+//        if self.browser.tabStripModel.count() > 1 {
+//            self.browser.windowDidBeginToClose()
+//            return false
+//        }
+//#else
+//        if let cnt = self.browser?.tabStripModel?.count(), cnt > 1 {
+//            if self.browser?.window != nil {
+//                self.browser?.windowDidBeginToClose()
+//            }
+//            return false
+//        }
+//#endif
         if let cnt = self.browser?.tabStripModel?.count(), cnt > 1 {
             if self.browser?.window != nil {
                 self.browser?.windowDidBeginToClose()
             }
             return false
         }
-#endif
         return true
     }
     

+ 5 - 5
PDF Office/PDF Master/Class/ChromiumTabs/src/Buttons/NewTabButton.m

@@ -35,10 +35,10 @@
 
 // Override to only accept clicks within the bounds of the defined path, not
 // the entire bounding box. |aPoint| is in the superview's coordinate system.
-- (NSView*)hitTest:(NSPoint)aPoint {
-	if ([self pointIsOverButton:aPoint])
-		return [super hitTest:aPoint];
-	return nil;
-}
+//- (NSView*)hitTest:(NSPoint)aPoint {
+//	if ([self pointIsOverButton:aPoint])
+//		return [super hitTest:aPoint];
+//	return nil;
+//}
 
 @end

+ 38 - 170
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/AppKitCategories/NSCursor+PDFListView.m

@@ -673,196 +673,70 @@ static NSCursor *textSelfSignCursor = nil;
 #pragma mark - Form cursor
 
 + (NSCursor *)radioFormCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *radioFormCursor = nil;
     if (nil == radioFormCursor) {
-        CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:CAnnotationTypeRadioButton];
-        CGRect rect = CGRectMake(0, 0, annotationModel.noteWidth + annotationModel.lineWidth, annotationModel.noteHeight + annotationModel.lineWidth);
-        NSImage *cursorImage = [[[NSImage alloc]initWithSize:CGSizeMake(rect.size.width, rect.size.height)] copy];
-        [cursorImage lockFocus];
-        CGContextRef ref3 = [NSGraphicsContext currentContext].CGContext;
-        
-        CGContextAddRect(ref3, CGRectMake(0, 0, annotationModel.noteWidth, annotationModel.noteHeight));
-        CGContextSetRGBFillColor(ref3, 229.0/255.0, 229.0/255.0, 1.0, 0.8);
-        CGContextFillPath(ref3);
-        
-        CGContextSaveGState(ref3);
-        CGContextAddRect(ref3, CGRectMake(annotationModel.lineWidth/2, annotationModel.lineWidth/2, annotationModel.noteWidth, annotationModel.noteHeight-annotationModel.lineWidth/2));
-        CGContextSetLineWidth(ref3, annotationModel.lineWidth/2);
-        CGContextSetRGBStrokeColor(ref3, 0.0/255.0, 0.0/255.0, 0.0/255.0, 0.6);
-        CGContextStrokePath(ref3);
-        CGContextRestoreGState(ref3);
-
-        [cursorImage unlockFocus];
-                
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsRadiobutton] copy];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         radioFormCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return radioFormCursor;
 }
 
 + (NSCursor *)checkFormCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *checkFormCursor = nil;
     if (nil == checkFormCursor) {
-        CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:CAnnotationTypeCheckBox];
-        CGRect rect = CGRectMake(0, 0, annotationModel.noteWidth + annotationModel.lineWidth, annotationModel.noteHeight + annotationModel.lineWidth);
-        NSImage *cursorImage = [[[NSImage alloc]initWithSize:CGSizeMake(rect.size.width, rect.size.height)] copy];
-        [cursorImage lockFocus];
-        CGContextRef ref3 = [NSGraphicsContext currentContext].CGContext;
-        
-        CGContextAddRect(ref3, CGRectMake(0, 0, annotationModel.noteWidth, annotationModel.noteHeight));
-        CGContextSetRGBFillColor(ref3, 229.0/255.0, 229.0/255.0, 1.0, 0.8);
-        CGContextFillPath(ref3);
-        
-        CGContextSaveGState(ref3);
-        CGContextAddRect(ref3, CGRectMake(annotationModel.lineWidth/2, annotationModel.lineWidth/2, annotationModel.noteWidth, annotationModel.noteHeight-annotationModel.lineWidth/2));
-        CGContextSetLineWidth(ref3, annotationModel.lineWidth/2);
-        CGContextSetRGBStrokeColor(ref3, 0.0/255.0, 0.0/255.0, 0.0/255.0, 0.6);
-        CGContextStrokePath(ref3);
-        CGContextRestoreGState(ref3);
-
-        [cursorImage unlockFocus];
-                
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsCheckbox] copy];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         checkFormCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return checkFormCursor;
 }
 
 + (NSCursor *)textFieldFormCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *textFieldFormCursor = nil;
     if (nil == textFieldFormCursor) {
-        CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:CAnnotationTypeTextField];
-        CGRect rect = CGRectMake(0, 0, annotationModel.noteWidth + annotationModel.lineWidth, annotationModel.noteHeight + annotationModel.lineWidth);
-        NSImage *cursorImage = [[[NSImage alloc]initWithSize:CGSizeMake(rect.size.width, rect.size.height)] copy];
-        [cursorImage lockFocus];
-        CGContextRef ref3 = [NSGraphicsContext currentContext].CGContext;
-        
-        CGContextAddRect(ref3, CGRectMake(0, 0, annotationModel.noteWidth, annotationModel.noteHeight));
-        CGContextSetRGBFillColor(ref3, 229.0/255.0, 229.0/255.0, 1.0, 0.8);
-        CGContextFillPath(ref3);
-        
-        CGContextSaveGState(ref3);
-        CGContextAddRect(ref3, CGRectMake(annotationModel.lineWidth/2, annotationModel.lineWidth/2, annotationModel.noteWidth, annotationModel.noteHeight-annotationModel.lineWidth/2));
-        CGContextSetLineWidth(ref3, annotationModel.lineWidth/2);
-        CGContextSetRGBStrokeColor(ref3, 0.0/255.0, 0.0/255.0, 0.0/255.0, 0.6);
-        CGContextStrokePath(ref3);
-        CGContextRestoreGState(ref3);
-
-        [cursorImage unlockFocus];
-                
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsTextfield] copy];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         textFieldFormCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return textFieldFormCursor;
 }
 
 + (NSCursor *)listBoxFormCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *listBoxFormCursor = nil;
     if (nil == listBoxFormCursor) {
-        CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:CAnnotationTypeListMenu];
-        CGRect rect = CGRectMake(0, 0, annotationModel.noteWidth + annotationModel.lineWidth, annotationModel.noteHeight + annotationModel.lineWidth);
-        NSImage *cursorImage = [[[NSImage alloc]initWithSize:CGSizeMake(rect.size.width, rect.size.height)] copy];
-        [cursorImage lockFocus];
-        CGContextRef ref3 = [NSGraphicsContext currentContext].CGContext;
-        
-        CGContextAddRect(ref3, CGRectMake(0, 0, annotationModel.noteWidth, annotationModel.noteHeight));
-        CGContextSetRGBFillColor(ref3, 229.0/255.0, 229.0/255.0, 1.0, 0.8);
-        CGContextFillPath(ref3);
-        
-        CGContextSaveGState(ref3);
-        CGContextAddRect(ref3, CGRectMake(annotationModel.lineWidth/2, annotationModel.lineWidth/2, annotationModel.noteWidth, annotationModel.noteHeight-annotationModel.lineWidth/2));
-        CGContextSetLineWidth(ref3, annotationModel.lineWidth/2);
-        CGContextSetRGBStrokeColor(ref3, 0.0/255.0, 0.0/255.0, 0.0/255.0, 0.6);
-        CGContextStrokePath(ref3);
-        CGContextRestoreGState(ref3);
-
-        [cursorImage unlockFocus];
-                
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsListbox] copy];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         listBoxFormCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return listBoxFormCursor;
 }
 
 + (NSCursor *)comboBoxFormCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *comboBoxFormCursor = nil;
     if (nil == comboBoxFormCursor) {
-        CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:CAnnotationTypeComboBox];
-        CGRect rect = CGRectMake(0, 0, annotationModel.noteWidth + annotationModel.lineWidth, annotationModel.noteHeight + annotationModel.lineWidth);
-        NSImage *cursorImage = [[[NSImage alloc]initWithSize:CGSizeMake(rect.size.width, rect.size.height)] copy];
-        [cursorImage lockFocus];
-        CGContextRef ref3 = [NSGraphicsContext currentContext].CGContext;
-        
-        CGContextAddRect(ref3, CGRectMake(0, 0, annotationModel.noteWidth, annotationModel.noteHeight));
-        CGContextSetRGBFillColor(ref3, 229.0/255.0, 229.0/255.0, 1.0, 0.8);
-        CGContextFillPath(ref3);
-        
-        CGContextSaveGState(ref3);
-        CGContextAddRect(ref3, CGRectMake(annotationModel.lineWidth/2, annotationModel.lineWidth/2, annotationModel.noteWidth, annotationModel.noteHeight-annotationModel.lineWidth/2));
-        CGContextSetLineWidth(ref3, annotationModel.lineWidth/2);
-        CGContextSetRGBStrokeColor(ref3, 0.0/255.0, 0.0/255.0, 0.0/255.0, 0.6);
-        CGContextStrokePath(ref3);
-        CGContextRestoreGState(ref3);
-
-        [cursorImage unlockFocus];
-                
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsPulldownmenu] copy];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         comboBoxFormCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return comboBoxFormCursor;
 }
 
 + (NSCursor *)actionButtonFormCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *actionButtonFormCursor = nil;
     if (nil == actionButtonFormCursor) {
-        CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:CAnnotationTypeActionButton];
-        CGRect rect = CGRectMake(0, 0, annotationModel.noteWidth + annotationModel.lineWidth, annotationModel.noteHeight + annotationModel.lineWidth);
-        NSImage *cursorImage = [[[NSImage alloc]initWithSize:CGSizeMake(rect.size.width, rect.size.height)] copy];
-        [cursorImage lockFocus];
-        CGContextRef ref3 = [NSGraphicsContext currentContext].CGContext;
-        
-        CGContextAddRect(ref3, CGRectMake(0, 0, annotationModel.noteWidth, annotationModel.noteHeight));
-        CGContextSetRGBFillColor(ref3, 229.0/255.0, 229.0/255.0, 1.0, 0.8);
-        CGContextFillPath(ref3);
-        
-        CGContextSaveGState(ref3);
-        CGContextAddRect(ref3, CGRectMake(annotationModel.lineWidth/2, annotationModel.lineWidth/2, annotationModel.noteWidth, annotationModel.noteHeight-annotationModel.lineWidth/2));
-        CGContextSetLineWidth(ref3, annotationModel.lineWidth/2);
-        CGContextSetRGBStrokeColor(ref3, 0.0/255.0, 0.0/255.0, 0.0/255.0, 0.6);
-        CGContextStrokePath(ref3);
-        CGContextRestoreGState(ref3);
-
-        [cursorImage unlockFocus];
-                
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsButton] copy];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         actionButtonFormCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return actionButtonFormCursor;
 }
 
 + (NSCursor *)signatureFormCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *signatureFormCursor = nil;
     if (nil == signatureFormCursor) {
-        CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:CAnnotationTypeSignature];
-        CGRect rect = CGRectMake(0, 0, annotationModel.noteWidth + annotationModel.lineWidth, annotationModel.noteHeight + annotationModel.lineWidth);
-        NSImage *cursorImage = [[[NSImage alloc]initWithSize:CGSizeMake(rect.size.width, rect.size.height)] copy];
-        [cursorImage lockFocus];
-        CGContextRef ref3 = [NSGraphicsContext currentContext].CGContext;
-        
-        CGContextAddRect(ref3, CGRectMake(0, 0, annotationModel.noteWidth, annotationModel.noteHeight));
-        CGContextSetRGBFillColor(ref3, 229.0/255.0, 229.0/255.0, 1.0, 0.8);
-        CGContextFillPath(ref3);
-        
-        CGContextSaveGState(ref3);
-        CGContextAddRect(ref3, CGRectMake(annotationModel.lineWidth/2, annotationModel.lineWidth/2, annotationModel.noteWidth, annotationModel.noteHeight-annotationModel.lineWidth/2));
-        CGContextSetLineWidth(ref3, annotationModel.lineWidth/2);
-        CGContextSetRGBStrokeColor(ref3, 0.0/255.0, 0.0/255.0, 0.0/255.0, 0.6);
-        CGContextStrokePath(ref3);
-        CGContextRestoreGState(ref3);
-
-        [cursorImage unlockFocus];
-                
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsSign] copy];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         signatureFormCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return signatureFormCursor;
@@ -871,66 +745,60 @@ static NSCursor *textSelfSignCursor = nil;
 #pragma mark - selfSignCursor
 
 + (NSCursor *)dotSelfSignCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *dotSelfSignCursor = nil;
     if (dotSelfSignCursor == nil) {
-        CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:CAnnotationTypeSignDot];
-
-        NSImage *cursorImage = [[CPDFStampAnnotation annotationImageWithAnnotationModel:annotationModel] copy];
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsPoint] copy];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         dotSelfSignCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return dotSelfSignCursor;
 }
 
 + (NSCursor *)circelSelfSignCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *circelSelfSignCursor = nil;
     if (circelSelfSignCursor == nil) {
-        CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:CAnnotationTypeSignCircle];
-        NSImage *cursorImage = [[CPDFStampAnnotation annotationImageWithAnnotationModel:annotationModel] copy];
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsRoundedrec] copy];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         circelSelfSignCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return circelSelfSignCursor;
 }
 
 + (NSCursor *)lineSelfSignCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *lineSelfSignCursor = nil;
     if (lineSelfSignCursor == nil) {
-        CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:CAnnotationTypeSignLine];
-        NSImage *cursorImage = [[CPDFStampAnnotation annotationImageWithAnnotationModel:annotationModel] copy];
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsFormLine] copy];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         lineSelfSignCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return lineSelfSignCursor;
 }
 
 + (NSCursor *)tureSelfSignCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *tureSelfSignCursor = nil;
     if (tureSelfSignCursor == nil) {
-        CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:CAnnotationTypeSignTure];
-        NSImage *cursorImage = [[CPDFStampAnnotation annotationImageWithAnnotationModel:annotationModel] copy];
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsTick] copy];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         tureSelfSignCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return tureSelfSignCursor;
 }
 
 + (NSCursor *)falseSelfSignCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *falseSelfSignCursor = nil;
     if (falseSelfSignCursor == nil) {
-        CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:CAnnotationTypeSignFalse];
-        NSImage *cursorImage = [[CPDFStampAnnotation annotationImageWithAnnotationModel:annotationModel] copy];
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsFork] copy];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         falseSelfSignCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return falseSelfSignCursor;
 }
 
 + (NSCursor *)dateSelfSignCursor:(CGFloat)scaleFactor {
-    [NSCursor addObserverForScaleChanged];
+    static NSCursor *dateSelfSignCursor = nil;
     if (dateSelfSignCursor == nil) {
         NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsDate] copy];
-        cursorImage = [NSCursor scaleImage:cursorImage scaleFactor:scaleFactor];
+        cursorImage = [NSCursor arrowCursorImage:cursorImage];
         dateSelfSignCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }
     return dateSelfSignCursor;

+ 8 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/AppKitCategories/NSImage+PDFListView.h

@@ -32,12 +32,19 @@ extern NSString *CPDFListViewImageNameCursorsArrow;
 extern NSString *CPDFListViewImageNameCursorsLink;
 extern NSString *CPDFListViewImageNameCursorsLine;
 
+extern NSString *CPDFListViewImageNameCursorsRadiobutton;
+extern NSString *CPDFListViewImageNameCursorsCheckbox;
+extern NSString *CPDFListViewImageNameCursorsTextfield;
+extern NSString *CPDFListViewImageNameCursorsListbox;
+extern NSString *CPDFListViewImageNameCursorsPulldownmenu;
+extern NSString *CPDFListViewImageNameCursorsButton;
+extern NSString *CPDFListViewImageNameCursorsSign;
+
 extern NSString *CPDFListViewImageNameCursorsDate;
 extern NSString *CPDFListViewImageNameCursorsFork;
 extern NSString *CPDFListViewImageNameCursorsFormLine;
 extern NSString *CPDFListViewImageNameCursorsPoint;
 extern NSString *CPDFListViewImageNameCursorsRoundedrec;
-extern NSString *CPDFListViewImageNameCursorsSign;
 extern NSString *CPDFListViewImageNameCursorsTick;
 
 + (NSImage *)bitmapPDFListViewImageWithSize:(NSSize)size scale:(CGFloat)scale drawingHandler:(void (^)(NSRect dstRect))drawingHandler;

+ 14 - 7
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/AppKitCategories/NSImage+PDFListView.m

@@ -32,13 +32,20 @@ NSString *CPDFListViewImageNameCursorsTable = @"CPDFListViewImageNameCursorsTabl
 NSString *CPDFListViewImageNameCursorsLink = @"CPDFListViewImageNameCursorsLink";
 NSString *CPDFListViewImageNameCursorsLine = @"CPDFListViewImageNameCursorsLine";
 
-NSString *CPDFListViewImageNameCursorsDate = @"CPDFListViewImageNameCursorsDate";
-NSString *CPDFListViewImageNameCursorsFork = @"CPDFListViewImageNameCursorsFork";
-NSString *CPDFListViewImageNameCursorsFormLine = @"CPDFListViewImageNameCursorsFormLine";
-NSString *CPDFListViewImageNameCursorsPoint = @"CPDFListViewImageNameCursorsPoint";
-NSString *CPDFListViewImageNameCursorsRoundedrec = @"CPDFListViewImageNameCursorsRoundedrec";
-NSString *CPDFListViewImageNameCursorsSign = @"CPDFListViewImageNameCursorsSign";
-NSString *CPDFListViewImageNameCursorsTick = @"CPDFListViewImageNameCursorsTick";
+NSString *CPDFListViewImageNameCursorsRadiobutton = @"KMImageNameCursorsRadiobutton";
+NSString *CPDFListViewImageNameCursorsCheckbox = @"KMImageNameCursorsCheckbox";
+NSString *CPDFListViewImageNameCursorsTextfield = @"KMImageNameCursorsTextfield";
+NSString *CPDFListViewImageNameCursorsListbox = @"KMImageNameCursorsListbox";
+NSString *CPDFListViewImageNameCursorsPulldownmenu = @"KMImageNameCursorsPulldownmenu";
+NSString *CPDFListViewImageNameCursorsButton = @"KMImageNameCursorsButton";
+NSString *CPDFListViewImageNameCursorsSign = @"KMImageNameCursorsSign";
+
+NSString *CPDFListViewImageNameCursorsDate = @"KMImageNameCursorsDate";
+NSString *CPDFListViewImageNameCursorsFork = @"KMImageNameCursorsFork";
+NSString *CPDFListViewImageNameCursorsFormLine = @"KMImageNameCursorsFormLine";
+NSString *CPDFListViewImageNameCursorsPoint = @"KMImageNameCursorsPoint";
+NSString *CPDFListViewImageNameCursorsRoundedrec = @"KMImageNameCursorsRoundedrec";
+NSString *CPDFListViewImageNameCursorsTick = @"KMImageNameCursorsTick";
 
 #define MAKE_CURSOR_IMAGE(name, width, height, instructions) \
 do { \

+ 12 - 8
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMImageToolTipWindow.swift

@@ -64,14 +64,18 @@ class KMImageToolTipWindow: KMAnimatedBorderlessWindow {
     // MARK: - Public Methods
     
     public func showForImageContext(_ aContext: KMImageToolTipContext, at aPoint: NSPoint) {
-        self.point = aPoint
-        
-        if aContext.isEqual(self.context) == false {
-            self.stopAnimation()
-            
-            self.context = aContext
-            
-            self.perform(#selector(_showDelayed), with: nil, afterDelay: self.isVisible ? ALT_SHOW_DELAY: DEFAULT_SHOW_DELAY)
+        if aContext != nil {
+            if aContext.isEqual(self.context) == false {
+                self.point = aPoint
+                
+                if aContext.isEqual(self.context) == false {
+                    self.stopAnimation()
+                    
+                    self.context = aContext
+                    
+                    self.perform(#selector(_showDelayed), with: nil, afterDelay: self.isVisible ? ALT_SHOW_DELAY: DEFAULT_SHOW_DELAY)
+                }
+            }
         }
     }