Browse Source

【幻灯片】鼠标样式变化相关

dinglingui 5 months ago
parent
commit
48126b48dc

+ 22 - 15
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -285,23 +285,30 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
 
 - (void)mouseMoved:(NSEvent *)event {
     if(self.isPresentationMode) {
-        if(self.presentationDrawView && self.presentationDrawView.isHidden == NO) {
-            NSImage *cursorImage = [[NSImage imageNamed:@"CPDFListViewImageNameCursorsLinkDestination"] copy];
-            NSCursor * cursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:NSMakePoint(8.0, 8.0)];
-            [cursor set];
-        } else {
-            NSImage *cursorImage = [CPDFListView dotImageWithColor:[NSColor redColor] size:CGSizeMake(20, 20)];
-            NSCursor * cursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:NSMakePoint(8.0, 8.0)];
-            [cursor set];
+        NSPoint tPoint = [event locationInView:self];
+
+        if(CGRectContainsPoint(self.bounds, tPoint)) {
+            if(self.presentationDrawView && self.presentationDrawView.isHidden == NO) {
+                NSImage *cursorImage = [[NSImage imageNamed:@"CPDFListViewImageNameCursorsLinkDestination"] copy];
+                NSCursor * cursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:NSMakePoint(8.0, 8.0)];
+                [cursor set];
+            } else {
+                NSImage *cursorImage = [CPDFListView dotImageWithColor:[NSColor redColor] size:CGSizeMake(20, 20)];
+                NSCursor * cursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:NSMakePoint(8.0, 8.0)];
+                [cursor set];
+            }
+            return;
         }
-        return;
     } else {
-        if(self.presentationDrawView && self.presentationDrawView.isHidden == NO) {
-            NSImage *cursorImage = [[NSImage imageNamed:@"CPDFListViewImageNameCursorsLinkDestination"] copy];
-            NSCursor * cursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:NSMakePoint(8.0, 8.0)];
-            [cursor set];
-            
-            return;
+        NSPoint tPoint = [event locationInView:self];
+        if(CGRectContainsPoint(self.bounds, tPoint)) {
+            if(self.presentationDrawView && self.presentationDrawView.isHidden == NO) {
+                NSImage *cursorImage = [[NSImage imageNamed:@"CPDFListViewImageNameCursorsLinkDestination"] copy];
+                NSCursor * cursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:NSMakePoint(8.0, 8.0)];
+                [cursor set];
+                
+                return;
+            }
         }
     }