Revision: 15255
http://sourceforge.net/p/skim-app/code/15255
Author: hofman
Date: 2025-05-22 09:40:43 +0000 (Thu, 22 May 2025)
Log Message:
-----------
separate condition in method for clarity, rename misspelled method
Modified Paths:
--------------
trunk/SKPresentationView.m
Modified: trunk/SKPresentationView.m
===================================================================
--- trunk/SKPresentationView.m 2025-05-22 08:55:58 UTC (rev 15254)
+++ trunk/SKPresentationView.m 2025-05-22 09:40:43 UTC (rev 15255)
@@ -426,7 +426,7 @@
- (void)drawFreehandNoteWithEvent:(NSEvent *)theEvent;
- (void)showHelpMenu;
-- (PDFAnnotation *)linkAnotationForMouse:(NSEvent *)theEvent;
+- (PDFAnnotation *)linkAnnotationForMouse:(NSEvent *)theEvent;
@end
@@ -783,17 +783,26 @@
#define IS_TABLET_EVENT(theEvent, deviceType) (([theEvent subtype] ==
NSEventSubtypeTabletProximity || [theEvent subtype] ==
NSEventSubtypeTabletPoint) && [NSEvent currentPointingDeviceType] == deviceType)
+- (BOOL)shouldDragWindowWithEvent:(NSEvent *)theEvent {
+ if (IS_TABLET_EVENT(theEvent, NSPointingDeviceTypePen))
+ return NO;
+ if (pvFlags.enableDrawing && ([theEvent modifierFlags] &
NSEventModifierFlagShift))
+ return NO;
+ NSWindow *window = [self window];
+ return ([window styleMask] & NSWindowStyleMaskResizable) != 0 &&
NSEqualRects([window frame], [[window screen] frame]) == NO;
+}
+
- (void)mouseDown:(NSEvent *)theEvent {
BOOL didHideMouse = pvFlags.cursorHidden;
if ([pageLayer opacity] <= 0.0) {
[pageLayer setOpacity:1.0];
} else if ([NSApp willDragMouse] == NO) {
- PDFDestination *link = [[self linkAnotationForMouse:theEvent]
destination];
+ PDFDestination *link = [[self linkAnnotationForMouse:theEvent]
destination];
if (link)
[self setPage:[link page]];
else
[self goToNextPage:self];
- } else if (IS_TABLET_EVENT(theEvent, NSPointingDeviceTypePen) == NO &&
([[self window] styleMask] & NSWindowStyleMaskResizable) != 0 &&
NSEqualRects([[self window] frame], [[[self window] screen] frame]) == NO &&
(pvFlags.enableDrawing == NO || ([theEvent modifierFlags] &
NSEventModifierFlagShift) == 0)) {
+ } else if ([self shouldDragWindowWithEvent:theEvent]) {
pvFlags.cursorHidden = NO;
[[NSCursor closedHandCursor] set];
[self dragWindowWithEvent:theEvent];
@@ -1080,7 +1089,7 @@
[menu popUpMenuPositioningItem:nil atLocation:point inView:self];
}
-- (PDFAnnotation *)linkAnotationForMouse:(NSEvent *)theEvent {
+- (PDFAnnotation *)linkAnnotationForMouse:(NSEvent *)theEvent {
if ([[page annotations] count] == 0)
return nil;
@@ -1131,7 +1140,7 @@
- (void)setCursorForMouse:(NSEvent *)theEvent {
if (pvFlags.cursorHidden)
[[NSCursor emptyCursor] set];
- else if ([[self linkAnotationForMouse:theEvent] destination])
+ else if ([[self linkAnnotationForMouse:theEvent] destination])
[[NSCursor pointingHandCursor] set];
else if (pvFlags.useArrowCursor)
[[NSCursor arrowCursor] set];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit