Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
b4c8a4ca by Claudio Cambra at 2025-02-12T22:27:10+00:00
macosx: Restore expand state of nodes in navigation sidebar view controller 
after internal nodes change

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -


1 changed file:

- modules/gui/macosx/library/VLCLibraryWindowNavigationSidebarViewController.m


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryWindowNavigationSidebarViewController.m
=====================================
@@ -124,6 +124,14 @@ static NSString * const VLCLibrarySegmentCellIdentifier = 
@"VLCLibrarySegmentCel
 {
     const VLCLibrarySegmentType currentSegmentType = 
self.libraryWindow.librarySegmentType;
 
+    NSMutableSet<NSNumber *> * const expandedSegmentTypes = NSMutableSet.set;
+    for (VLCLibrarySegment * const segment in self.treeController.content) {
+        NSTreeNode * const node = [self 
nodeForSegmentType:segment.segmentType];
+        if ([self.outlineView isItemExpanded:node]) {
+            [expandedSegmentTypes addObject:@(segment.segmentType)];
+        }
+    }
+
     self.ignoreSegmentSelectionChanges = YES;
 
     _segments = VLCLibrarySegment.librarySegments;
@@ -143,6 +151,13 @@ static NSString * const VLCLibrarySegmentCellIdentifier = 
@"VLCLibrarySegmentCel
     self.ignoreSegmentSelectionChanges = NO;
 
     [self updateBookmarkObservation];
+
+    for (VLCLibrarySegment * const segment in self.treeController.content) {
+        if ([expandedSegmentTypes containsObject:@(segment.segmentType)]) {
+            NSTreeNode * const node = [self 
nodeForSegmentType:segment.segmentType];
+            [self.outlineView expandItem:node];
+        }
+    }
 }
 
 - (void)updateBookmarkObservation



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/b4c8a4cafa8982ab8e596e393afb010b23de8ed8

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/b4c8a4cafa8982ab8e596e393afb010b23de8ed8
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to