From 57e236ad531a1cd2b37db3671e017663da5af045 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Fri, 8 Mar 2024 19:42:59 +0800 Subject: [PATCH] macosx: Select artists view when clicking on music sidebar entry, making music sidebar entry unselectable Signed-off-by: Claudio Cambra --- .../VLCLibraryWindowNavigationSidebarController.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/gui/macosx/library/VLCLibraryWindowNavigationSidebarController.m b/modules/gui/macosx/library/VLCLibraryWindowNavigationSidebarController.m index 347ee0aaff..5c07599264 100644 --- a/modules/gui/macosx/library/VLCLibraryWindowNavigationSidebarController.m +++ b/modules/gui/macosx/library/VLCLibraryWindowNavigationSidebarController.m @@ -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];