Browse Source

macosx: Properly set parent type for represented item in VLCLibraryVideoCollectionViewContainerView

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
pull/162/head
Claudio Cambra 3 years ago
committed by Jean-Baptiste Kempf
parent
commit
2eec6c4fd0
  1. 9
      modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerViewDataSource.m

9
modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerViewDataSource.m

@ -32,6 +32,7 @@
#import "library/VLCLibraryRepresentedItem.h"
#import "library/video-library/VLCLibraryVideoGroupDescriptor.h"
#import "library/video-library/VLCLibraryVideoCollectionViewContainerView.h"
#import "main/VLCMain.h"
@ -278,7 +279,9 @@ NSString * const VLCLibraryVideoCollectionViewDataSourceDisplayedCollectionChang
{
VLCLibraryCollectionViewItem * const viewItem = [collectionView makeItemWithIdentifier:VLCLibraryCellIdentifier forIndexPath:indexPath];
const id<VLCMediaLibraryItemProtocol> item = self.collectionArray[indexPath.item];
VLCLibraryRepresentedItem * const representedItem = [[VLCLibraryRepresentedItem alloc] initWithItem:item parentType:VLCMediaLibraryParentGroupTypeVideoLibrary]; // TODO: recents?
// TODO: Find a more elegant way to do this
VLCLibraryVideoCollectionViewContainerView * const containerView = (VLCLibraryVideoCollectionViewContainerView *)collectionView.superview.superview.superview;
VLCLibraryRepresentedItem * const representedItem = [[VLCLibraryRepresentedItem alloc] initWithItem:item parentType:containerView.videoGroup];
viewItem.representedItem = representedItem;
return viewItem;
@ -300,7 +303,9 @@ viewForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind
VLCLibraryCollectionViewMediaItemSupplementaryDetailView * const mediaItemSupplementaryDetailView = [collectionView makeSupplementaryViewOfKind:kind withIdentifier:VLCLibraryCollectionViewMediaItemSupplementaryDetailViewKind forIndexPath:indexPath];
const id<VLCMediaLibraryItemProtocol> item = self.collectionArray[indexPath.item];
VLCLibraryRepresentedItem * const representedItem = [[VLCLibraryRepresentedItem alloc] initWithItem:item parentType:VLCMediaLibraryParentGroupTypeVideoLibrary]; // TODO: recents?
// TODO: Find a more elegant way to do this
VLCLibraryVideoCollectionViewContainerView * const containerView = (VLCLibraryVideoCollectionViewContainerView *)collectionView.superview.superview.superview;
VLCLibraryRepresentedItem * const representedItem = [[VLCLibraryRepresentedItem alloc] initWithItem:item parentType:containerView.videoGroup];
mediaItemSupplementaryDetailView.representedItem = representedItem;
mediaItemSupplementaryDetailView.selectedItem = [collectionView itemAtIndexPath:indexPath];

Loading…
Cancel
Save