mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 09:00:56 +00:00
Improvements in working with selection indexes in NSCollectionView.m
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@36266 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d1bb44a910
commit
b8cf0d6957
1 changed files with 17 additions and 7 deletions
|
@ -325,16 +325,17 @@ static NSString *placeholderItem = nil;
|
|||
|
||||
- (void)setSelectionIndexes:(NSIndexSet *)indexes
|
||||
{
|
||||
if (!_isSelectable || [_selectionIndexes isEqual:indexes])
|
||||
if (!_isSelectable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME: Reset selectionIndexes in SetContent:
|
||||
|
||||
if (![_selectionIndexes isEqual:indexes])
|
||||
{
|
||||
RELEASE(_selectionIndexes);
|
||||
_selectionIndexes = indexes;
|
||||
RETAIN(_selectionIndexes);
|
||||
}
|
||||
|
||||
|
||||
NSUInteger index = 0;
|
||||
|
@ -373,6 +374,11 @@ static NSString *placeholderItem = nil;
|
|||
if (itemPrototype)
|
||||
{
|
||||
ASSIGN(collectionItem, [itemPrototype copy]);
|
||||
// NSView *itemView = [collectionItem view];
|
||||
// NSRect itemViewFrame = [itemView frame];
|
||||
// NSRect frame = NSMakeRect (itemViewFrame.origin.x, itemViewFrame.origin.y, _itemSize.width, _itemSize.height);
|
||||
// [itemView setFrame:frame];
|
||||
// _itemSize = _minItemSize;
|
||||
[collectionItem setRepresentedObject:object];
|
||||
}
|
||||
return collectionItem;
|
||||
|
@ -427,7 +433,11 @@ static NSString *placeholderItem = nil;
|
|||
}
|
||||
|
||||
// TODO: Restore item's selected state
|
||||
//[self setSelectionIndexes:[_selectionIndexes copy]];
|
||||
|
||||
// Force recalculation of the frames of each item's view
|
||||
_itemSize = _minItemSize;
|
||||
_tileWidth = -1;
|
||||
[self tile];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue