Revision: 29132 http://sourceforge.net/p/bibdesk/svn/29132 Author: hofman Date: 2025-04-18 15:16:50 +0000 (Fri, 18 Apr 2025) Log Message: ----------- Restrict number of columns in grid mode to number of icons. Include padding in bottom margin. Draw cells in debbug mode.
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-18 14:31:21 UTC (rev 29131) +++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2025-04-18 15:16:50 UTC (rev 29132) @@ -1149,7 +1149,7 @@ - (CGFloat)_topMargin { return DEFAULT_MARGIN.height; } -- (CGFloat)_bottomMargin { return 0.0; } +- (CGFloat)_bottomMargin { return _padding.height; } - (CGFloat)_textHeight; { @@ -1231,7 +1231,7 @@ } - (void)_getColumns:(NSInteger *)numberOfColumns rows:(NSInteger *)numberOfRows fittingContentWidth:(CGFloat)width { - *numberOfColumns = MAX( 1, (NSInteger)floor( ( width - 2 * DEFAULT_MARGIN.width ) / [self _columnWidth] ) ); + *numberOfColumns = MAX( 1, MIN( (NSInteger)[self numberOfIcons], (NSInteger)floor( ( width - 2 * DEFAULT_MARGIN.width ) / [self _columnWidth] ) ) ); *numberOfRows = ( [self numberOfIcons] + *numberOfColumns - 1 ) / *numberOfColumns; } @@ -2535,6 +2535,8 @@ [[NSColor redColor] setFill]; else [[NSColor greenColor] setFill]; + NSFrameRect(NSMakeRect(DEFAULT_MARGIN.width + [self _columnWidth] * c, DEFAULT_MARGIN.height + [self _rowHeight] * r, [self _columnWidth], [self _rowHeight])); + [[NSColor blueColor] setFill]; NSFrameRect(NSUnionRect(NSInsetRect(fileRect, -shadowBlur, 0.0), NSInsetRect(textRect, 2.0, 0.0))); [NSGraphicsContext restoreGraphicsState]; #endif 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