[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Fix incorrect state of navigation buttons on main library window load

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Wed Sep 7 19:50:44 UTC 2022



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
e6988dc1 by Claudio Cambra at 2022-09-07T19:25:43+00:00
macosx: Fix incorrect state of navigation buttons on main library window load

Signed-off-by: Claudio Cambra <claudio.cambra at gmail.com>

- - - - -
2f4ba073 by Claudio Cambra at 2022-09-07T19:25:43+00:00
macosx: Fix bugs with library window restoration and setting of navigation stack state

Signed-off-by: Claudio Cambra <claudio.cambra at gmail.com>

- - - - -


5 changed files:

- modules/gui/macosx/library/VLCLibraryAudioDataSource.m
- modules/gui/macosx/library/VLCLibraryNavigationStack.h
- modules/gui/macosx/library/VLCLibraryNavigationStack.m
- modules/gui/macosx/library/VLCLibraryNavigationState.m
- modules/gui/macosx/library/VLCLibraryWindow.m


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryAudioDataSource.m
=====================================
@@ -200,7 +200,7 @@
 {
     [self.segmentedControl setTarget:self];
     [self.segmentedControl setAction:@selector(segmentedControlAction:)];
-    [self segmentedControlAction:self];
+    [self segmentedControlAction:[[[VLCMain sharedInstance] libraryWindow] navigationStack]];
 }
 
 - (void)reloadEmptyViewAppearance


=====================================
modules/gui/macosx/library/VLCLibraryNavigationStack.h
=====================================
@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface VLCLibraryNavigationStack : NSObject
 
- at property (readwrite, strong) VLCLibraryWindow *delegate;
+ at property (readwrite, nonatomic) VLCLibraryWindow *delegate;
 @property (readonly) BOOL forwardsAvailable;
 @property (readonly) BOOL backwardsAvailable;
 
@@ -39,4 +39,4 @@ NS_ASSUME_NONNULL_BEGIN
 
 @end
 
-NS_ASSUME_NONNULL_END
\ No newline at end of file
+NS_ASSUME_NONNULL_END


=====================================
modules/gui/macosx/library/VLCLibraryNavigationStack.m
=====================================
@@ -72,6 +72,12 @@
     return self;
 }
 
+- (void)setDelegate:(VLCLibraryWindow *)delegate
+{
+    _delegate = delegate;
+    [self updateDelegateNavigationButtons];
+}
+
 - (BOOL)forwardsAvailable
 {
     NSUInteger numNavigationStates = _navigationStates.count;
@@ -157,4 +163,4 @@
     [self updateDelegateNavigationButtons];
 }
 
- at end
\ No newline at end of file
+ at end


=====================================
modules/gui/macosx/library/VLCLibraryNavigationState.m
=====================================
@@ -39,4 +39,4 @@
     return navState;
 }
 
- at end
\ No newline at end of file
+ at end


=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -995,8 +995,12 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
     [libraryWindow.gridVsListSegmentedControl setSelectedSegment:rememberedSelectedLibraryViewModeSegment];
     [libraryWindow.libraryAudioDataSource.segmentedControl setSelectedSegment:rememberedSelectedLibraryViewAudioSegment];
 
-    [libraryWindow segmentedControlAction:libraryWindow.navigationStack]; // Prevent actions being added to the nav stack
+    // We don't want to add these to the navigation stack...
     [libraryWindow.libraryAudioDataSource segmentedControlAction:libraryWindow.navigationStack];
+    [libraryWindow segmentedControlAction:libraryWindow.navigationStack];
+
+    // But we do want the "final" initial position to be added. So we manually invoke the navigation stack
+    [libraryWindow.navigationStack appendCurrentLibraryState];
 
     completionHandler(libraryWindow, nil);
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a81ac86bd49a4373195fb951723ebe58773c20d8...2f4ba073a396d1bacf0402790d0002c2a3d534f6

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a81ac86bd49a4373195fb951723ebe58773c20d8...2f4ba073a396d1bacf0402790d0002c2a3d534f6
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list