Revision: 3221 http://skim-app.svn.sourceforge.net/skim-app/?rev=3221&view=rev Author: hofman Date: 2007-11-19 05:08:25 -0800 (Mon, 19 Nov 2007)
Log Message: ----------- Make alternate menu items for zoom to physical size and zoom to width/height. Modified Paths: -------------- trunk/Dutch.lproj/Localizable.strings trunk/Dutch.lproj/MainMenu.nib/classes.nib trunk/Dutch.lproj/MainMenu.nib/keyedobjects.nib trunk/English.lproj/MainMenu.nib/classes.nib trunk/English.lproj/MainMenu.nib/keyedobjects.nib trunk/French.lproj/Localizable.strings trunk/French.lproj/MainMenu.nib/classes.nib trunk/French.lproj/MainMenu.nib/keyedobjects.nib trunk/German.lproj/Localizable.strings trunk/German.lproj/MainMenu.nib/classes.nib trunk/German.lproj/MainMenu.nib/keyedobjects.nib trunk/Italian.lproj/Localizable.strings trunk/Italian.lproj/MainMenu.nib/classes.nib trunk/Italian.lproj/MainMenu.nib/keyedobjects.nib trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/Spanish.lproj/Localizable.strings trunk/Spanish.lproj/MainMenu.nib/classes.nib trunk/Spanish.lproj/MainMenu.nib/keyedobjects.nib Modified: trunk/Dutch.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/MainMenu.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/MainMenu.nib/classes.nib 2007-11-19 11:54:46 UTC (rev 3220) +++ trunk/Dutch.lproj/MainMenu.nib/classes.nib 2007-11-19 13:08:25 UTC (rev 3221) @@ -4,6 +4,7 @@ ACTIONS = { addBookmark = id; alternatePaste = id; + alternateZoomToFit = id; autoCropAll = id; autoSelectContent = id; changeAnnotationMode = id; Modified: trunk/Dutch.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainMenu.nib/classes.nib =================================================================== --- trunk/English.lproj/MainMenu.nib/classes.nib 2007-11-19 11:54:46 UTC (rev 3220) +++ trunk/English.lproj/MainMenu.nib/classes.nib 2007-11-19 13:08:25 UTC (rev 3221) @@ -4,6 +4,7 @@ ACTIONS = { addBookmark = id; alternatePaste = id; + alternateZoomToFit = id; autoCropAll = id; autoSelectContent = id; changeAnnotationMode = id; Modified: trunk/English.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/French.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/French.lproj/MainMenu.nib/classes.nib =================================================================== --- trunk/French.lproj/MainMenu.nib/classes.nib 2007-11-19 11:54:46 UTC (rev 3220) +++ trunk/French.lproj/MainMenu.nib/classes.nib 2007-11-19 13:08:25 UTC (rev 3221) @@ -4,6 +4,7 @@ ACTIONS = { addBookmark = id; alternatePaste = id; + alternateZoomToFit = id; autoCropAll = id; autoSelectContent = id; changeAnnotationMode = id; Modified: trunk/French.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/German.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/German.lproj/MainMenu.nib/classes.nib =================================================================== --- trunk/German.lproj/MainMenu.nib/classes.nib 2007-11-19 11:54:46 UTC (rev 3220) +++ trunk/German.lproj/MainMenu.nib/classes.nib 2007-11-19 13:08:25 UTC (rev 3221) @@ -4,6 +4,7 @@ ACTIONS = { addBookmark = id; alternatePaste = id; + alternateZoomToFit = id; autoCropAll = id; autoSelectContent = id; changeAnnotationMode = id; Modified: trunk/German.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainMenu.nib/classes.nib =================================================================== --- trunk/Italian.lproj/MainMenu.nib/classes.nib 2007-11-19 11:54:46 UTC (rev 3220) +++ trunk/Italian.lproj/MainMenu.nib/classes.nib 2007-11-19 13:08:25 UTC (rev 3221) @@ -4,6 +4,7 @@ ACTIONS = { addBookmark = id; alternatePaste = id; + alternateZoomToFit = id; autoCropAll = id; autoSelectContent = id; changeAnnotationMode = id; Modified: trunk/Italian.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-11-19 11:54:46 UTC (rev 3220) +++ trunk/SKMainWindowController.h 2007-11-19 13:08:25 UTC (rev 3221) @@ -245,6 +245,7 @@ - (IBAction)doZoomOut:(id)sender; - (IBAction)doZoomToActualSize:(id)sender; - (IBAction)doZoomToFit:(id)sender; +- (IBAction)alternateZoomToFit:(id)sender; - (IBAction)doZoomToSelection:(id)sender; - (IBAction)zoomInOut:(id)sender; - (IBAction)zoomInActualOut:(id)sender; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-11-19 11:54:46 UTC (rev 3220) +++ trunk/SKMainWindowController.m 2007-11-19 13:08:25 UTC (rev 3221) @@ -1585,6 +1585,23 @@ [pdfView setAutoScales:NO]; } +- (IBAction)alternateZoomToFit:(id)sender { + PDFDisplayMode displayMode = [pdfView displayMode]; + NSRect frame = [pdfView frame]; + float scaleFactor = [pdfView scaleFactor]; + if (displayMode == kPDFDisplaySinglePage || displayMode == kPDFDisplayTwoUp) { + // zoom to width + float width = NSWidth([pdfView convertRect:[[pdfView documentView] bounds] fromView:[pdfView documentView]]) / scaleFactor; + [pdfView setScaleFactor:NSWidth(frame) / width]; + } else { + // zoom to height + float height = NSHeight([pdfView convertRect:[[pdfView currentPage] boundsForBox:[pdfView displayBox]] fromPage:[pdfView currentPage]]) / scaleFactor; + if ([pdfView displaysPageBreaks]) + height += 10.0; + [pdfView setScaleFactor:NSHeight(frame) / height]; + } +} + - (IBAction)zoomInOut:(id)sender { if ([sender selectedSegment] == 0) [pdfView zoomOut:sender]; @@ -5149,6 +5166,14 @@ return [self isPresentation] == NO && NSIsEmptyRect([pdfView currentSelectionRect]) == NO; } else if (action == @selector(doZoomToFit:)) { return [self isPresentation] == NO && [pdfView autoScales] == NO; + } else if (action == @selector(alternateZoomToFit:)) { + PDFDisplayMode displayMode = [pdfView displayMode]; + if (displayMode == kPDFDisplaySinglePage || displayMode == kPDFDisplayTwoUp) { + [menuItem setTitle:NSLocalizedString(@"Zoom To Width", @"Menu item title")]; + } else { + [menuItem setTitle:NSLocalizedString(@"Zoom To Height", @"Menu item title")]; + } + return [self isPresentation] == NO; } else if (action == @selector(doAutoScale:)) { return [pdfView autoScales] == NO; } else if (action == @selector(toggleAutoScale:)) { Modified: trunk/Spanish.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/Spanish.lproj/MainMenu.nib/classes.nib =================================================================== --- trunk/Spanish.lproj/MainMenu.nib/classes.nib 2007-11-19 11:54:46 UTC (rev 3220) +++ trunk/Spanish.lproj/MainMenu.nib/classes.nib 2007-11-19 13:08:25 UTC (rev 3221) @@ -4,6 +4,7 @@ ACTIONS = { addBookmark = id; alternatePaste = id; + alternateZoomToFit = id; autoCropAll = id; autoSelectContent = id; changeAnnotationMode = id; Modified: trunk/Spanish.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit