mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 04:50:47 +00:00
Fix implementation of resize when elements overflow the size of the view
This commit is contained in:
parent
b96dbcba2e
commit
5ff478ac85
3 changed files with 22 additions and 89 deletions
|
@ -1670,14 +1670,30 @@ static NSString *placeholderItem = nil;
|
|||
_indexPathsToItems = RETAIN([NSMapTable strongToStrongObjectsMapTable]);
|
||||
}
|
||||
|
||||
- (void) _setFrameWithoutTile: (NSRect)f
|
||||
{
|
||||
_frame = f;
|
||||
}
|
||||
|
||||
- (void) _updateParentViewFrame
|
||||
{
|
||||
NSEnumerator *oe = [_itemsToAttributes objectEnumerator];
|
||||
NSCollectionViewLayoutAttributes *attrs = nil;
|
||||
|
||||
NSRect cf = [self frame];
|
||||
NSSize ps = cf.size;
|
||||
|
||||
while ((attrs = [oe nextObject]) != nil)
|
||||
{
|
||||
NSRect f = [attrs frame];
|
||||
CGFloat w = f.origin.x + f.size.width;
|
||||
CGFloat h = f.origin.y + f.size.height;
|
||||
|
||||
ps.width = (w > ps.width) ? w : ps.width;
|
||||
ps.height = (h > ps.height) ? h : ps.height;
|
||||
}
|
||||
|
||||
cf.size = ps;
|
||||
[self _setFrameWithoutTile: cf];
|
||||
}
|
||||
|
||||
- (void) reloadData
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue