Revision: 12645 http://sourceforge.net/p/skim-app/code/12645 Author: hofman Date: 2021-12-27 10:26:31 +0000 (Mon, 27 Dec 2021) Log Message: ----------- temporarily hide loupe window when handling other mouse events
Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2021-12-26 14:51:38 UTC (rev 12644) +++ trunk/SKPDFView.m 2021-12-27 10:26:31 UTC (rev 12645) @@ -240,6 +240,7 @@ - (void)showHelpMenu; - (void)updateMagnifyWithEvent:(NSEvent *)theEvent; +- (void)hideLoupeWindow; - (void)updateLoupeBackgroundColor; - (void)removeLoupeWindow; @@ -1722,16 +1723,28 @@ [self performSelectorOnce:@selector(doAutoHideCursor) afterDelay:AUTO_HIDE_DELAY]; } } else if (modifiers == NSCommandKeyMask) { + BOOL wantsLoupe = [self hideLoupeWindow]; [self doSelectSnapshotWithEvent:theEvent]; + if (wantsLoupe) + [self updateMagnifyWithEvent:nil]; } else if (modifiers == (NSCommandKeyMask | NSShiftKeyMask)) { + BOOL wantsLoupe = [self hideLoupeWindow]; [self doPdfsyncWithEvent:theEvent]; + if (wantsLoupe) + [self updateMagnifyWithEvent:nil]; } else if (modifiers == (NSCommandKeyMask | NSAlternateKeyMask)) { + BOOL wantsLoupe = [self hideLoupeWindow]; [self doMarqueeZoomWithEvent:theEvent]; + if (wantsLoupe) + [self updateMagnifyWithEvent:nil]; } else if ((area & SKReadingBarArea) && (area & kPDFLinkArea) == 0) { + BOOL wantsLoupe = [self hideLoupeWindow]; if ((area & (SKResizeUpDownArea | SKResizeLeftRightArea))) [self doResizeReadingBarWithEvent:theEvent]; else [self doDragReadingBarWithEvent:theEvent]; + if (wantsLoupe) + [self updateMagnifyWithEvent:nil]; } else if ((area & kPDFPageArea) == 0) { [self doDragWithEvent:theEvent]; } else if (toolMode == SKMoveToolMode) { @@ -4824,6 +4837,13 @@ } } +- (BOOL)hideLoupeWindow { + if ([loupeWindow parentWindow] == nil) + return NO; + [self updateMagnifyWithEvent:[NSEvent mouseEventWithType:NSLeftMouseDown location:NSMakePoint(-1.0, -1.0) modifierFlags:0 timestamp:0 windowNumber:[[self window] windowNumber] context:nil eventNumber:0 clickCount:1 pressure:0.0]]; + return YES; +} + - (void)updateLoupeBackgroundColor { if (loupeWindow == nil) return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit