Revision: 16368
http://sourceforge.net/p/skim-app/code/16368
Author: hofman
Date: 2026-06-07 16:14:24 +0000 (Sun, 07 Jun 2026)
Log Message:
-----------
delay markup toolmode for double click to allow triple click
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2026-06-07 15:53:47 UTC (rev 16367)
+++ trunk/SKPDFView.m 2026-06-07 16:14:24 UTC (rev 16368)
@@ -1671,6 +1671,11 @@
return NO;
}
+- (void)performMarkupToolMode {
+ if (toolMode == SKToolModeNote && IS_MARKUP(annotationMode) && [[self
currentSelection] hasCharacters])
+ [self addMarkupAnnotationWithType:annotationMode selection:nil];
+}
+
#define IS_TABLET_EVENT(theEvent, deviceType) (([theEvent subtype] ==
NSEventSubtypeTabletProximity || [theEvent subtype] ==
NSEventSubtypeTabletPoint) && [NSEvent currentPointingDeviceType] == deviceType)
- (void)mouseDown:(NSEvent *)theEvent{
@@ -1787,9 +1792,19 @@
[self doDragContentWithEvent:theEvent];
} else if ([self doDragSelectedTextWithEvent:theEvent] == NO) {
[self setCurrentAnnotation:nil];
- [super mouseDown:theEvent];
- if (toolMode == SKToolModeNote && [self canAddNotes] &&
IS_MARKUP(annotationMode) && [[self currentSelection] hasCharacters])
- [self addMarkupAnnotationWithType:annotationMode selection:nil];
+ if (toolMode == SKToolModeNote && IS_MARKUP(annotationMode) && [self
canAddNotes]) {
+ [[self class] cancelPreviousPerformRequestsWithTarget:self
selector:@selector(performMarkupToolMode) object:nil];
+ BOOL mayMultiClick = [theEvent clickCount] == 2 && [NSApp
willDragMouse] == NO;
+ [super mouseDown:theEvent];
+ if ([[self currentSelection] hasCharacters]) {
+ if (mayMultiClick)
+ [self performSelectorOnce:@selector(performMarkupToolMode)
afterDelay:[NSEvent doubleClickInterval]];
+ else
+ [self addMarkupAnnotationWithType:annotationMode
selection:nil];
+ }
+ } else {
+ [super mouseDown:theEvent];
+ }
}
}
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