Permalink
Browse files

Search field can get focus, fullscreen works again, white line remove…

…d in fullscreen view
  • Loading branch information...
1 parent 2c38949 commit a63ca038094b4dd113dcffed2acfa13415cafa6c @pieteromvlee pieteromvlee committed Mar 9, 2011
Showing with 19 additions and 10 deletions.
  1. +13 −10 BCCollectionView.m
  2. +1 −0 BCCollectionViewLayoutManager.h
  3. +5 −0 BCCollectionViewLayoutManager.m
View
@@ -300,16 +300,18 @@ - (NSViewController *)emptyViewControllerForInsertion
- (void)addMissingViewControllerForItemAtIndex:(NSUInteger)anIndex withFrame:(NSRect)aRect
{
- NSViewController *viewController = [self emptyViewControllerForInsertion];
- [visibleViewControllers setObject:viewController forKey:[NSNumber numberWithInteger:anIndex]];
- [[viewController view] setFrame:aRect];
- [[viewController view] setAutoresizingMask:NSViewMaxXMargin | NSViewMaxYMargin];
-
- id itemToLoad = [contentArray objectAtIndex:anIndex];
- [delegate collectionView:self willShowViewController:viewController forItem:itemToLoad];
- [self addSubview:[viewController view]];
- if ([selectionIndexes containsIndex:anIndex])
- [self delegateUpdateSelectionForItemAtIndex:anIndex];
+ if (anIndex < [contentArray count]) {
+ NSViewController *viewController = [self emptyViewControllerForInsertion];
+ [visibleViewControllers setObject:viewController forKey:[NSNumber numberWithInteger:anIndex]];
+ [[viewController view] setFrame:aRect];
+ [[viewController view] setAutoresizingMask:NSViewMaxXMargin | NSViewMaxYMargin];
+
+ id itemToLoad = [contentArray objectAtIndex:anIndex];
+ [delegate collectionView:self willShowViewController:viewController forItem:itemToLoad];
+ [self addSubview:[viewController view]];
+ if ([selectionIndexes containsIndex:anIndex])
+ [self delegateUpdateSelectionForItemAtIndex:anIndex];
+ }
}
- (void)addMissingGroupHeaders
@@ -491,6 +493,7 @@ - (void)reloadDataWithItems:(NSArray *)newContent emptyCaches:(BOOL)shouldEmptyC
- (void)reloadDataWithItems:(NSArray *)newContent groups:(NSArray *)newGroups emptyCaches:(BOOL)shouldEmptyCaches
{
[self deselectAllItems];
+ [layoutManager cancelItemEnumerator];
if (!delegate)
return;
@@ -14,6 +14,7 @@
}
@property (retain) NSArray *itemLayouts;
- (id)initWithCollectionView:(BCCollectionView *)collectionView; //assigned
+- (void)cancelItemEnumerator;
- (void)enumerateItems:(BCCollectionViewLayoutOperationIterator)itemIterator completionBlock:(dispatch_block_t)completionBlock;
#pragma mark Primitives
@@ -20,6 +20,11 @@ - (id)initWithCollectionView:(BCCollectionView *)aCollectionView
return self;
}
+- (void)cancelItemEnumerator
+{
+ [queue cancelAllOperations];
+}
+
- (void)enumerateItems:(BCCollectionViewLayoutOperationIterator)itemIterator completionBlock:(dispatch_block_t)completionBlock
{
[queue cancelAllOperations];

0 comments on commit a63ca03

Please sign in to comment.