mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 06:30:55 +00:00
When adding subviews (items) to a NSCollectionView we need to set them in a non-visible area first so they don't get drawn in front of a view when the collection view is behind the latter.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@36583 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
588eab8526
commit
7ac1d3dd1c
1 changed files with 11 additions and 2 deletions
|
@ -198,8 +198,9 @@ static NSString *placeholderItem = nil;
|
|||
// if it hasn't been done already.
|
||||
NSCollectionViewItem *collectionItem = [self itemAtIndex:index];
|
||||
NSView *view = [collectionItem view];
|
||||
[view setFrame:[self frameForItemAtIndex:index]];
|
||||
}
|
||||
NSRect itemFrame = [self frameForItemAtIndex:index];
|
||||
[view setFrame:itemFrame];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
|
@ -503,6 +504,14 @@ static NSString *placeholderItem = nil;
|
|||
{
|
||||
[item setSelected:YES];
|
||||
}
|
||||
|
||||
// Frank LeGrand 4/25/13:
|
||||
// We set this initial rect as a workaround for a weird display
|
||||
// issue in our app where the item view would get drawn in front
|
||||
// of another view (a transparent NSBox) whereas it should stay
|
||||
// behind.
|
||||
NSRect initRect = NSMakeRect (-10000,-10000,100,100);
|
||||
[[item view] setFrame:initRect];
|
||||
[self addSubview:[item view]];
|
||||
}
|
||||
return item;
|
||||
|
|
Loading…
Reference in a new issue