gnustep / libs-gui

The GNUstep gui library is a library of graphical user interface classes written completely in the Objective-C language; the classes are based upon Apple's Cocoa framework (which came from the OpenStep specification). *** Larger patches require copyright assignment to FSF. please file bugs here. ***
http://www.gnustep.org
GNU General Public License v3.0
279 stars 103 forks source link

Fix issue with NSCollectionView and single column views #319

Closed johnathan-becker closed 2 weeks ago

johnathan-becker commented 2 weeks ago

This pull request improves the frameForItemAtIndex: method by refining the layout calculation logic for items. I removed the _horizontalMargin offset from the initial x position to align items more precisely with the view’s edges, standardizing row alignment by resetting x to 0 at the start of each row, and introducing dynamic resizing for single-column layouts, ensuring items span the full width of the view. These updates enhance the visual consistency of both multi-column and single-column layouts, while maintaining functionality for features like dragging offsets. The changes have been tested to ensure alignment and layout behavior remain robust and predictable.

Screenshot from 2024-11-15 13-03-50 Screenshot from 2024-11-15 12-56-32

johnathan-becker commented 2 weeks ago

@fredkiefer I believe automation is just broken on master. I am getting the same failures on this MR.

fredkiefer commented 2 weeks ago

As this class was mostly written by Greg, I think it would be better for him to review this change.