Revision: 14875 http://sourceforge.net/p/skim-app/code/14875 Author: hofman Date: 2025-01-25 15:38:57 +0000 (Sat, 25 Jan 2025) Log Message: ----------- add Back and Forward menu items to split PDF context menu
Modified Paths: -------------- trunk/SKSecondaryPDFView.m Modified: trunk/SKSecondaryPDFView.m =================================================================== --- trunk/SKSecondaryPDFView.m 2025-01-25 15:08:40 UTC (rev 14874) +++ trunk/SKSecondaryPDFView.m 2025-01-25 15:38:57 UTC (rev 14875) @@ -592,6 +592,21 @@ iNext = [menu indexOfItemWithTarget:self andAction:@selector(goToNextPage:)]; iPrev = [menu indexOfItemWithTarget:self andAction:@selector(goToPreviousPage:)]; + + if (iPrev == -1) + i = iNext; + else if (iNext == -1) + i = iPrev; + else + i = MAX(iPrev, iNext); + if (i == -1) + i = [menu numberOfItems]; + + if ([self canGoBack]) + [menu insertItemWithTitle:NSLocalizedString(@"Back", @"Menu item title") action:@selector(goBack:) target:self tag:0 atIndex:++i]; + if ([self canGoForward]) + [menu insertItemWithTitle:NSLocalizedString(@"Forward", @"Menu item title") action:@selector(goForward:) target:self tag:0 atIndex:++i]; + if (iNext == -1) i = iPrev; else if (iPrev == -1) @@ -603,7 +618,7 @@ [menu insertItemWithTitle:NSLocalizedString(@"Scroll Tool", @"Menu item title") action:@selector(changeToolMode:) target:self tag:0 atIndex:i]; [menu insertItemWithTitle:NSLocalizedString(@"Text Tool", @"Menu item title") action:@selector(changeToolMode:) target:self tag:1 atIndex:i]; [menu insertItem:[NSMenuItem separatorItem]atIndex:i]; - + return menu; } 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