Allow CPCollectionView to grow horizontally #145

maport opened this Issue May 26, 2009 · 4 comments


None yet

3 participants

maport commented May 26, 2009

Currently CPCollectionView arranges its items by starting at the top-left, filling each (fixed width) row left-to-right and adjusting its height as necessary to fit in the required number of rows.

As far as I can gather Cocoa doesn't have this either but it would be useful to have an alternative mode which would render items top-to-bottom, filling fixed-height columns and adjusting the width to fit.

This would then allow it to be used for rendering lists of items which scroll horizontally.

The only required change to the interface would be an additional accessor to set/get the "grow" direction.

I'll have a go at this myself if I get the time.

maport commented May 28, 2009

I've commited a patch for this at:

This adds a new orientation property which can be set to CPCollectionViewHorizontalOrientation to "orient" the view horizontally rather than the standard vertical arrangement:

- (void)setOrientation:(CPCollectionViewOrientation)anOrientation

In this orientation the view has fixed height, items are arranged in columns starting on the left and the width is varied.

It is particularly useful if you want to render a one row list that scrolls horizontally.

The patched CPCollectionView should be completely backward compatible and users who don't use setOrientation shouldn't encounter any differences. However I have deprecated setVerticalMargin in favour of a new setDivisionMargin method since the "vertical margin" is the margin between rows in the standard vertical orientation but becomes the margin between columns in the the horizontal orientation.

Any better suggestions than setDivisionMargin welcome; a "division" is the general term I am using to represent a row or column.

cappbot commented May 9, 2012

Milestone: Someday. Labels: #needs-review, AppKit, feature. What's next? This issue is pending an architectural or implementation design decision and should be discussed or voted on.


No one else has requested it.


cappbot commented Feb 16, 2013

Milestone: Someday. Labels: #wont-fix, AppKit, feature. What's next? A reviewer or core team member has decided against acting upon this issue.

@cappbot cappbot closed this Feb 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment