mirror of
https://code.videolan.org/videolan/vlc
synced 2024-10-03 01:31:53 +02:00
macosx: Calculate horizontal video collection view using static item size in collection view delegate
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
parent
43f3299116
commit
c315516b95
@ -184,6 +184,7 @@
|
|||||||
scrollViewInsets.bottom +
|
scrollViewInsets.bottom +
|
||||||
collectionViewLayoutInset.top +
|
collectionViewLayoutInset.top +
|
||||||
collectionViewLayoutInset.bottom;
|
collectionViewLayoutInset.bottom;
|
||||||
|
const CGFloat itemHeight = _collectionViewDelegate.staticItemSize.height;
|
||||||
const CGFloat width = scrollViewInsets.left +
|
const CGFloat width = scrollViewInsets.left +
|
||||||
scrollViewInsets.right +
|
scrollViewInsets.right +
|
||||||
collectionViewLayoutInset.left +
|
collectionViewLayoutInset.left +
|
||||||
@ -194,14 +195,12 @@
|
|||||||
// If we don't return a size larger than 0 then we run into issues with the collection
|
// If we don't return a size larger than 0 then we run into issues with the collection
|
||||||
// view layout not trying to properly calculate its size. So let's return something
|
// view layout not trying to properly calculate its size. So let's return something
|
||||||
NSLog(@"Unable to provide accurate height for container -- providing rough size");
|
NSLog(@"Unable to provide accurate height for container -- providing rough size");
|
||||||
const CGFloat roughValue = _collectionViewLayout.itemSize.height + insetsHeight;
|
const CGFloat roughValue = itemHeight + insetsHeight;
|
||||||
return NSMakeSize(width, roughValue);
|
return NSMakeSize(width, roughValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_groupDescriptor.isHorizontalBarCollectionView) {
|
if (_groupDescriptor.isHorizontalBarCollectionView) {
|
||||||
const CGFloat viewHeight = _collectionViewLayout.itemSize.height +
|
const CGFloat viewHeight = itemHeight + insetsHeight + 15; // Account for horizontal scrollbar
|
||||||
insetsHeight +
|
|
||||||
15; // Account for horizontal scrollbar
|
|
||||||
return NSMakeSize(width, viewHeight);
|
return NSMakeSize(width, viewHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user