Skip to content
Snippets Groups Projects
Commit 224085ec authored by Claudio Cambra's avatar Claudio Cambra Committed by Felix Paul Kühne
Browse files

macosx: Implement viewForSupplementaryElementOfKind in shows data source


Signed-off-by: default avatarClaudio Cambra <developer@claudiocambra.com>
parent 34723732
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,8 @@
#import "library/VLCLibraryCollectionViewItem.h"
#import "library/VLCLibraryCollectionViewFlowLayout.h"
#import "library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.h"
#import "library/VLCLibraryCollectionViewSupplementaryElementView.h"
#import "library/VLCLibraryModel.h"
#import "library/VLCLibraryRepresentedItem.h"
......@@ -213,4 +215,37 @@
return viewItem;
}
- (NSView *)collectionView:(NSCollectionView *)collectionView
viewForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind
atIndexPath:(NSIndexPath *)indexPath
{
if([kind isEqualToString:NSCollectionElementKindSectionHeader]) {
VLCLibraryCollectionViewSupplementaryElementView * const sectionHeadingView =
[collectionView makeSupplementaryViewOfKind:kind
withIdentifier:VLCLibrarySupplementaryElementViewIdentifier
forIndexPath:indexPath];
VLCMediaLibraryShow * const show = self.showsArray[indexPath.section];
sectionHeadingView.stringValue = show.displayString;
return sectionHeadingView;
} else if ([kind isEqualToString:VLCLibraryCollectionViewMediaItemSupplementaryDetailViewKind]) {
NSString * const viewIdentifier =
VLCLibraryCollectionViewMediaItemSupplementaryDetailViewIdentifier;
VLCLibraryCollectionViewMediaItemSupplementaryDetailView * const mediaItemDetailView =
[collectionView makeSupplementaryViewOfKind:kind
withIdentifier:viewIdentifier
forIndexPath:indexPath];
const id<VLCMediaLibraryItemProtocol> item = [self libraryItemAtIndexPath:indexPath
forCollectionView:collectionView];
VLCLibraryRepresentedItem * const representedItem =
[[VLCLibraryRepresentedItem alloc] initWithItem:item parentType:self.currentParentType];
mediaItemDetailView.representedItem = representedItem;
mediaItemDetailView.selectedItem = [collectionView itemAtIndexPath:indexPath];
return mediaItemDetailView;
}
return nil;
}
@end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment