Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

CPCollectionView -maxItemSize support, content binding, collection view item loading ... [+4] #1700

Merged
merged 15 commits into from

7 participants

cacaodev CappBot Mike Cristina Miles Tinsley Andrew Hankinson Alexander Ljungberg
cacaodev
Collaborator

Includes:
• CPContentBinding support. it was there but unusable due to a late minItemSize update.
• CPCollectionViewItem can be loaded from an external cib. You can now have outlets and bindings from/to the prototype. They will be automatically connected for each item in the collection view.
• Support for maxitemSize width and height, including zero width/height interpreted as fully sizable.

The layout is now left-based which is the default in cocoa. But our current layout with centered views is also fine. You can switch back to it with the -uniformResizing flag. (It's just a bit more costly because we need to relayout more often).

With manual test of course.

cacaodev added some commits
cacaodev cacaodev CPCollectionView Implemented - (CPView)draggingViewForItemsAtIndexes:…
…(CPIndexSet)indexes withEvent:(CPEvent)event offset:(CGPoint)dragImageOffset

and the corresponding delegate method from where you can ask for the default dragged view. Multiple selection not implemented yet.
bafd62d
cacaodev cacaodev Merge remote-tracking branch 'upstream/master' into CPCollectionView-…
…dragged-view
8641738
cacaodev cacaodev CPCollectionView dragging: fix a bug where the dragging view was crea…
…ted from content instead of selection
57c8d22
cacaodev cacaodev CPCollectionView : Allow the prototype view to be loaded from a cib
With this commit CPCollectionView can load subviews from an external
cib. Outlets, actions and bindings between the view and the
prototype are restaured when the view is loaded.
8b5c0fb
cacaodev cacaodev CPCollectionView test. Nib test and bindings test.
Bindings:
collectionView CPContentBinding -> arrayController.selectedObjects
prototypeView CPValueBinding -> owner.representedObject
112c6bd
cacaodev cacaodev Update min/maxItemSize lazylly instead of subclassing -awakeFromCib
Binders can set values before -awakeFromCib. We were too late
and the bound content was not visible.
efc5b8f
cacaodev cacaodev Partially rewrote layout.
it is not optimal but certainly better than the previous  version. A
collection view was unusable when resized through its scroll view.
524bd52
cacaodev cacaodev Freeze autoresizingMask
The mask is 0 and cannot be changed.
Cocoa allows any value but ignores them for layout.
34d6d06
cacaodev cacaodev -setItemPrototype:
    Do not cache removed items in -reloadContent when the item prototype changes.

maxItemSize:
    Interpreted as horiz/vertic expandable when zero size and the proto view has a CPViewWidth|HeightSizable. (per cocoa but not documented).
    maxItemSize height support.

Fixed: incorrect position when num items < numberOfColumns.

Rewrote layout engine. Splitted the computation of size, columns count, rows count from the actual layout where we set the frame.
This will help when/if we support insertion/mutation of  -content or view animations.
We can also be more lazy when the computation results stay the same.

Added shared -init. Whitespace cleaning.

CPCollectionviewCibTest:
    Add ability to set the 2 kinds of prototypes, one loading its view from a cib, the other with a view outlet in the same cib.
    Loaded protoype: the bound textfield can commit its value to the model.
    UI for setting maxNumberOfColumns|Rows min|maxItemSize
4c1ebfb
CappBot
Collaborator

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

cacaodev added some commits
cacaodev cacaodev test app: CPSelectionIndexesBinding test 9a1e757
cacaodev cacaodev Merge branch 'CPCollectionView-dragged-view' into CPCollectionView-dr…
…agAndDrop
2ab1493
cacaodev cacaodev Simplify the "layout computing" method and change its name
There is not need to use that much arguments because the result is stored in ivars.
CPCollectionViewItem -copy: set properties correctly even if the collectionView overrides them.
dd5bd17
cacaodev cacaodev Drop support with drop indicator.
FIXED: undefined _horizontalMargin
Test app: UI for switching uniformSubviewsResizing.
6b7b63d
cacaodev cacaodev Merge remote-tracking branch 'upstream/master' into CPCollectionViewI…
…tem-loading
6a72855
cacaodev cacaodev nib2cibed example 00fea3e
Mike

+1

CappBot
Collaborator

Milestone: Someday. Vote: 1. Label: #new. What's next? A reviewer should examine this issue.

CappBot
Collaborator

Milestone: Someday. Votes: 2. Label: #new. What's next? A reviewer should examine this issue.

CappBot
Collaborator

Milestone: Someday. Votes: 3. Label: #new. What's next? A reviewer should examine this issue.

CappBot
Collaborator

Milestone: Someday. Votes: 4. Label: #new. What's next? A reviewer should examine this issue.

Andrew Hankinson

This issue seems to be quite popular and seems to be ready for a core committer to review and merge.

+#accepted
+#needs-review

CappBot
Collaborator

Milestone: Someday. Votes: 4. Label: #accepted. What's next? A reviewer should examine this issue.

Alexander Ljungberg
Owner

assignee=aljungberg
milestone=0.9.7

CappBot
Collaborator

Assignee: aljungberg. Milestone: 0.9.7. Votes: 4. Label: #accepted. What's next? A reviewer should examine this issue.

Alexander Ljungberg aljungberg was assigned
Alexander Ljungberg aljungberg referenced this pull request from a commit
Alexander Ljungberg aljungberg Refs #1700. Use more macros. 8ed85ed
Alexander Ljungberg aljungberg referenced this pull request from a commit
Alexander Ljungberg aljungberg Refs #1700. Fixed: setItemPrototype crash.
Setting the item prototype without first adding the collection view to a view would cause a crash, as would reloadContent.

This fix makes sure the collection view doesn't try to tile itself unless it has a frame.
21efb90
Alexander Ljungberg aljungberg merged commit 00fea3e into from
Alexander Ljungberg
Owner

Merged. Thanks!

+#fixed

CappBot
Collaborator

Assignee: aljungberg. Milestone: 0.9.7. Votes: 4. Label: #fixed. What's next? This issue is considered successfully resolved.

cacaodev cacaodev deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 25, 2012
  1. cacaodev

    CPCollectionView Implemented - (CPView)draggingViewForItemsAtIndexes:…

    cacaodev authored
    …(CPIndexSet)indexes withEvent:(CPEvent)event offset:(CGPoint)dragImageOffset
    
    and the corresponding delegate method from where you can ask for the default dragged view. Multiple selection not implemented yet.
Commits on Feb 29, 2012
  1. cacaodev
  2. cacaodev

    CPCollectionView dragging: fix a bug where the dragging view was crea…

    cacaodev authored
    …ted from content instead of selection
Commits on Nov 30, 2012
  1. cacaodev

    CPCollectionView : Allow the prototype view to be loaded from a cib

    cacaodev authored
    With this commit CPCollectionView can load subviews from an external
    cib. Outlets, actions and bindings between the view and the
    prototype are restaured when the view is loaded.
  2. cacaodev

    CPCollectionView test. Nib test and bindings test.

    cacaodev authored
    Bindings:
    collectionView CPContentBinding -> arrayController.selectedObjects
    prototypeView CPValueBinding -> owner.representedObject
  3. cacaodev

    Update min/maxItemSize lazylly instead of subclassing -awakeFromCib

    cacaodev authored
    Binders can set values before -awakeFromCib. We were too late
    and the bound content was not visible.
  4. cacaodev

    Partially rewrote layout.

    cacaodev authored
    it is not optimal but certainly better than the previous  version. A
    collection view was unusable when resized through its scroll view.
  5. cacaodev

    Freeze autoresizingMask

    cacaodev authored
    The mask is 0 and cannot be changed.
    Cocoa allows any value but ignores them for layout.
Commits on Dec 6, 2012
  1. cacaodev

    -setItemPrototype:

    cacaodev authored
        Do not cache removed items in -reloadContent when the item prototype changes.
    
    maxItemSize:
        Interpreted as horiz/vertic expandable when zero size and the proto view has a CPViewWidth|HeightSizable. (per cocoa but not documented).
        maxItemSize height support.
    
    Fixed: incorrect position when num items < numberOfColumns.
    
    Rewrote layout engine. Splitted the computation of size, columns count, rows count from the actual layout where we set the frame.
    This will help when/if we support insertion/mutation of  -content or view animations.
    We can also be more lazy when the computation results stay the same.
    
    Added shared -init. Whitespace cleaning.
    
    CPCollectionviewCibTest:
        Add ability to set the 2 kinds of prototypes, one loading its view from a cib, the other with a view outlet in the same cib.
        Loaded protoype: the bound textfield can commit its value to the model.
        UI for setting maxNumberOfColumns|Rows min|maxItemSize
Commits on Dec 7, 2012
  1. cacaodev
  2. cacaodev
Commits on Dec 8, 2012
  1. cacaodev

    Simplify the "layout computing" method and change its name

    cacaodev authored
    There is not need to use that much arguments because the result is stored in ivars.
    CPCollectionViewItem -copy: set properties correctly even if the collectionView overrides them.
  2. cacaodev

    Drop support with drop indicator.

    cacaodev authored
    FIXED: undefined _horizontalMargin
    Test app: UI for switching uniformSubviewsResizing.
Commits on Jan 18, 2013
  1. cacaodev
  2. cacaodev

    nib2cibed example

    cacaodev authored
Something went wrong with that request. Please try again.