Revision: 25365 http://sourceforge.net/p/bibdesk/svn/25365 Author: hofman Date: 2021-01-11 17:01:27 +0000 (Mon, 11 Jan 2021) Log Message: ----------- Implement bigger/smaller font actions to zoom in/out
Modified Paths: -------------- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m =================================================================== --- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2021-01-11 13:43:46 UTC (rev 25364) +++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2021-01-11 17:01:27 UTC (rev 25365) @@ -3677,6 +3677,29 @@ [self _selectFirstVisibleIcon]; } +- (void)changeFont:(id)sender { + if (_fvFlags.displayMode != FVDisplayModeGrid) { + NSBeep(); + return; + } + switch ([sender currentFontAction]) { + case NSSizeUpFontAction: + if ([self iconScale] < [self maxIconScale]) + [self zoomIn:sender]; + else + NSBeep(); + break; + case NSSizeDownFontAction: + if ([self iconScale] > [self minIconScale]) + [self zoomOut:sender]; + else + NSBeep(); + break; + default: + break; + } +} + // scrollRectToVisible doesn't scroll the entire rect to visible - (BOOL)scrollRectToVisible:(NSRect)aRect { @@ -3840,11 +3863,11 @@ BOOL isEditable = [self isEditable]; NSUInteger selectionCount = [_selectionIndexes count]; - if (action == @selector(zoomIn:)) + if (action == @selector(zoomIn:)) { return _fvFlags.displayMode == FVDisplayModeGrid && [self iconScale] < [self maxIconScale]; - else if (action == @selector(zoomOut:)) + } else if (action == @selector(zoomOut:)) { return _fvFlags.displayMode == FVDisplayModeGrid && [self iconScale] > [self minIconScale]; - else if (action == @selector(displayGrid:)) { + } else if (action == @selector(displayGrid:)) { [anItem setState:_fvFlags.displayMode == FVDisplayModeGrid ? NSOnState : NSOffState]; return YES; } else if (action == @selector(displayColumn:)) { @@ -3853,21 +3876,21 @@ } else if (action == @selector(displayRow:)) { [anItem setState:_fvFlags.displayMode == FVDisplayModeRow ? NSOnState : NSOffState]; return YES; - } else if (action == @selector(revealInFinder:)) + } else if (action == @selector(revealInFinder:)) { return [aURL isFileURL] && [_selectionIndexes count] == 1 && NO == isMissing; - else if (action == @selector(openSelectedURLs:) || action == @selector(copy:)) + } else if (action == @selector(openSelectedURLs:) || action == @selector(copy:)) { return selectionCount > 0; - else if (action == @selector(delete:) || action == @selector(cut:)) + } else if (action == @selector(delete:) || action == @selector(cut:)) { return isEditable && selectionCount > 0; - else if (action == @selector(selectAll:)) + } else if (action == @selector(selectAll:)) { return ([self numberOfIcons] > 0); - else if (action == @selector(previewAction:)) + } else if (action == @selector(previewAction:)) { return selectionCount > 0; - else if (action == @selector(paste:)) + } else if (action == @selector(paste:)) { return isEditable; - else if (action == @selector(submenuAction:)) + } else if (action == @selector(submenuAction:)) { return selectionCount > 1 || ([_selectionIndexes count] == 1 && [aURL isFileURL]); - else if (action == @selector(changeFinderLabel:) || [anItem tag] == FVChangeLabelMenuItemTag) { + } else if (action == @selector(changeFinderLabel:) || [anItem tag] == FVChangeLabelMenuItemTag) { BOOL enabled = NO; NSInteger state = NSOffState; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit