Revision: 29111 http://sourceforge.net/p/bibdesk/svn/29111 Author: hofman Date: 2025-04-16 09:26:21 +0000 (Wed, 16 Apr 2025) Log Message: ----------- make helper methods into helper functions
Modified Paths: -------------- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m =================================================================== --- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2025-04-16 08:47:15 UTC (rev 29110) +++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2025-04-16 09:26:21 UTC (rev 29111) @@ -1249,7 +1249,7 @@ return [scrollView autohidesScrollers]; } -- (NSSize)_contentSizeForScrollView:(NSScrollView *)scrollView minWidth:(CGFloat)minWidth hasVerticalScroller:(BOOL)hasVerticalScroller { +static NSSize _contentSizeForScrollViewHavingVerticalScroller(NSScrollView *scrollView, CGFloat minWidth, BOOL hasVerticalScroller) { // NSScrollView does not have a method to get the content size for arbitrary controlSize, so we substract the scroller widths ourselves NSSize contentSize = [[scrollView class] contentSizeForFrameSize:[scrollView frame].size hasHorizontalScroller:NO hasVerticalScroller:NO borderType:[scrollView borderType]]; if (hasVerticalScroller) @@ -1260,7 +1260,7 @@ return contentSize; } -- (NSSize)_contentSizeForScrollView:(NSScrollView *)scrollView minHeight:(CGFloat)minHeight hasHorizontalScroller:(BOOL)hasHorizontalScroller { +static NSSize _contentSizeForScrollViewHavingHorizontalScroller(NSScrollView *scrollView, CGFloat minHeight, BOOL hasHorizontalScroller) { // NSScrollView does not have a method to get the content size for arbitrary controlSize, so we substract the scroller widths ourselves NSSize contentSize = [[scrollView class] contentSizeForFrameSize:[scrollView frame].size hasHorizontalScroller:NO hasVerticalScroller:NO borderType:[scrollView borderType]]; if (hasHorizontalScroller) @@ -1286,12 +1286,12 @@ CGFloat minWidth = ceil( DEFAULT_PADDING.width + MIN_AUTO_ICON_SCALE * DEFAULT_ICON_SIZE.width + 2 * DEFAULT_MARGIN.width ); // first assume we need a vertical scroller... - contentSize = [self _contentSizeForScrollView:scrollView minWidth:minWidth hasVerticalScroller:YES]; + contentSize = _contentSizeForScrollViewHavingVerticalScroller(scrollView, minWidth, YES); [self _setPaddingAndIconSizeFromContentWidth:contentSize.width]; if (contentSize.height > [self _frameHeight]) { // we have sufficient height to fit all icons, so recalculate without vertical scroller - contentSize = [self _contentSizeForScrollView:scrollView minWidth:minWidth hasVerticalScroller:NO]; + contentSize = _contentSizeForScrollViewHavingVerticalScroller(scrollView, minWidth, NO); [self _setPaddingAndIconSizeFromContentWidth:contentSize.width]; if (_numberOfRows > 0 && contentSize.height < [self _frameHeight]) { @@ -1320,12 +1320,12 @@ CGFloat minHeight = ceil( DEFAULT_PADDING.height + MIN_AUTO_ICON_SCALE * DEFAULT_ICON_SIZE.height + DEFAULT_MARGIN.height ); // first assume we need a horizontal scroller... - contentSize = [self _contentSizeForScrollView:scrollView minHeight:minHeight hasHorizontalScroller:YES]; + contentSize = _contentSizeForScrollViewHavingHorizontalScroller(scrollView, minHeight, YES); [self _setPaddingAndIconSizeFromContentHeight:contentSize.height]; if (contentSize.width > [self _frameWidth]) { // we have sufficient width to fit all icons, so recalculate without horizontal scroller - contentSize = [self _contentSizeForScrollView:scrollView minHeight:minHeight hasHorizontalScroller:NO]; + contentSize = _contentSizeForScrollViewHavingHorizontalScroller(scrollView, minHeight, NO); [self _setPaddingAndIconSizeFromContentHeight:contentSize.height]; if (_numberOfColumns > 0 && contentSize.width < [self _frameWidth]) { @@ -1355,12 +1355,12 @@ CGFloat minWidth = [self _frameWidth]; // first assume we don't need a vertical scroller... - contentSize = [self _contentSizeForScrollView:scrollView minWidth:minWidth hasVerticalScroller:NO]; + contentSize = _contentSizeForScrollViewHavingVerticalScroller(scrollView, minWidth, NO); [self _setColumnsAndRowsFromContentWidth:contentSize.width]; if (contentSize.height < [self _frameHeight]) { // we have insufficient height to fit all icons, so recalculate with vertical scroller - contentSize = [self _contentSizeForScrollView:scrollView minWidth:minWidth hasVerticalScroller:YES]; + contentSize = _contentSizeForScrollViewHavingVerticalScroller(scrollView, minWidth, YES); [self _setColumnsAndRowsFromContentWidth:contentSize.width]; } 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