macosx: Select artists view when clicking on music sidebar entry, making music sidebar entry unselectable

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
Claudio Cambra 2024-03-08 19:42:59 +08:00 committed by Felix Paul Kühne
parent 3ba89ea810
commit 57e236ad53
1 changed files with 9 additions and 0 deletions

View File

@ -100,6 +100,15 @@ static NSString * const VLCLibrarySegmentCellIdentifier = @"VLCLibrarySegmentCel
return cellView;
}
- (NSIndexSet *)outlineView:(NSOutlineView *)outlineView selectionIndexesForProposedSelection:(nonnull NSIndexSet *)proposedSelectionIndexes
{
if (proposedSelectionIndexes.count == 0 || proposedSelectionIndexes.firstIndex != VLCLibraryMusicSegment) {
return proposedSelectionIndexes;
} else {
return [NSIndexSet indexSetWithIndex:VLCLibraryArtistsMusicSubSegment];
}
}
- (void)outlineViewSelectionDidChange:(NSNotification *)notification
{
NSTreeNode * const node = (NSTreeNode *)[_outlineView itemAtRow:_outlineView.selectedRow];