[vlc-commits] [Git][videolan/vlc][master] macosx: Ensure playlist toggle button state is correctly set

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Thu Jun 30 09:45:24 UTC 2022



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


Commits:
3172b2e3 by Claudio Cambra at 2022-06-30T09:30:56+00:00
macosx: Ensure playlist toggle button state is correctly set

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

- - - - -


1 changed file:

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


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -357,6 +357,12 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
     // of the buttons to be correctly recalculated, working around this issue
     [self toggleToolbarShown:self];
     [self toggleToolbarShown:self];
+
+    // The playlist toggle button's default state is OFF so we set it to ON if the playlist
+    // is not collapsed when we open the library window
+    if (![_mainSplitView isSubviewCollapsed:_playlistView]) {
+        _playQueueToggle.state = NSControlStateValueOn;
+    }
 }
 
 - (void)dealloc
@@ -697,6 +703,12 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
 - (void)splitViewDidResizeSubviews:(NSNotification *)notification
 {
     _lastPlaylistWidthBeforeCollaps = [_playlistView frame].size.width;
+
+    if (![_mainSplitView isSubviewCollapsed:_playlistView]) {
+        _playQueueToggle.state = NSControlStateValueOn;
+    } else {
+        _playQueueToggle.state = NSControlStateValueOff;
+    }
 }
 
 - (void)togglePlaylist
@@ -705,8 +717,10 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
     CGFloat splitViewWidth = _mainSplitView.frame.size.width;
     if ([_mainSplitView isSubviewCollapsed:_playlistView]) {
         [_mainSplitView setPosition:splitViewWidth - _lastPlaylistWidthBeforeCollaps ofDividerAtIndex:0];
+        _playQueueToggle.state = NSControlStateValueOn;
     } else {
         [_mainSplitView setPosition:splitViewWidth ofDividerAtIndex:0];
+        _playQueueToggle.state = NSControlStateValueOff;
     }
 }
 



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3172b2e36c277085f75a07df6520e76c298c947b
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