Revision: 12563 http://sourceforge.net/p/skim-app/code/12563 Author: hofman Date: 2021-11-17 10:42:56 +0000 (Wed, 17 Nov 2021) Log Message: ----------- Invalidate resetCrop: menu item when we never cropped any page
Modified Paths: -------------- trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKMainWindowController_UI.m Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2021-11-17 10:27:13 UTC (rev 12562) +++ trunk/SKMainWindowController.h 2021-11-17 10:42:56 UTC (rev 12563) @@ -193,6 +193,7 @@ unsigned int isSwitchingFullScreen:1; unsigned int wantsPresentation:1; unsigned int recentInfoNeedsUpdate:1; + unsigned int hasCropped:1; } mwcFlags; } Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2021-11-17 10:27:13 UTC (rev 12562) +++ trunk/SKMainWindowController.m 2021-11-17 10:42:56 UTC (rev 12563) @@ -590,6 +590,7 @@ if ([box isEqualToString:@""] == NO) [[pdfDoc pageAtIndex:i] setBounds:NSRectFromString(box) forBox:kPDFDisplayBoxCropBox]; } + mwcFlags.hasCropped = 1; } } @@ -2125,6 +2126,8 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:SKDisplayPageBoundsKey]) [self updateRightStatus]; + + mwcFlags.hasCropped = 1; } - (void)handleDocumentBeginWrite:(NSNotification *)notification { Modified: trunk/SKMainWindowController_UI.m =================================================================== --- trunk/SKMainWindowController_UI.m 2021-11-17 10:27:13 UTC (rev 12562) +++ trunk/SKMainWindowController_UI.m 2021-11-17 10:42:56 UTC (rev 12563) @@ -1698,8 +1698,10 @@ return [[self pdfDocument] isLocked] == NO && [self hasOverview] == NO; } else if (action == @selector(rotateRight:) || action == @selector(rotateLeft:) || action == @selector(rotateAllRight:) || action == @selector(rotateAllLeft:)) { return [[self pdfDocument] isLocked] == NO; - } else if (action == @selector(cropAll:) || action == @selector(crop:) || action == @selector(autoCropAll:) || action == @selector(smartAutoCropAll:) || action == @selector(resetCrop:)) { + } else if (action == @selector(cropAll:) || action == @selector(crop:) || action == @selector(autoCropAll:) || action == @selector(smartAutoCropAll:)) { return [self interactionMode] != SKPresentationMode && [[self pdfDocument] isLocked] == NO; + } else if (action == @selector(resetCrop:)) { + return mwcFlags.hasCropped == 1 && [self interactionMode] != SKPresentationMode && [[self pdfDocument] isLocked] == NO; } else if (action == @selector(autoSelectContent:)) { return [self interactionMode] != SKPresentationMode && [self hasOverview] == NO && [[self pdfDocument] isLocked] == NO && [pdfView toolMode] == SKSelectToolMode; } else if (action == @selector(takeSnapshot:)) { 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