[vlc-commits] [Git][videolan/vlc][master] macosx: Make the playlist accessible when using the video view in the main library window

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Nov 10 06:10:12 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
cd262087 by Claudio Cambra at 2022-11-10T05:49:47+00:00
macosx: Make the playlist accessible when using the video view in the main library window

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


1 changed file:

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


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -188,13 +188,6 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
     [self.librarySortButton setHidden:NO];
     [self.librarySearchField setEnabled:YES];
 
-    self.videoView.translatesAutoresizingMaskIntoConstraints = NO;
-    [self.contentView addSubview:self.videoView];
-    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.videoView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.mainSplitView attribute:NSLayoutAttributeWidth multiplier:1. constant:1.]];
-    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.videoView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:self.mainSplitView attribute:NSLayoutAttributeHeight multiplier:1. constant:1.]];
-    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.videoView attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.mainSplitView attribute:NSLayoutAttributeCenterX multiplier:1. constant:1.]];
-    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.videoView attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.mainSplitView attribute:NSLayoutAttributeCenterY multiplier:1. constant:1.]];
-
     NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
     [notificationCenter addObserver:self
                            selector:@selector(shouldShowFullscreenController:)
@@ -872,7 +865,7 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
 // This handles reopening the video view when the user has closed it.
 - (void)reopenVideoView
 {
-    if(!self.hasActiveVideo || !self.videoView.hidden) {
+    if(!self.hasActiveVideo) {
         return;
     }
 
@@ -885,13 +878,33 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
     [self enableVideoPlaybackAppearance];
 }
 
-- (void)enableVideoPlaybackAppearance
+- (void)presentVideoView
 {
-    [_mediaSourceView removeFromSuperviewWithoutNeedingDisplay];
-    [_videoLibraryView removeFromSuperviewWithoutNeedingDisplay];
-    [_audioLibraryView removeFromSuperviewWithoutNeedingDisplay];
+    for (NSView *subview in _libraryTargetView.subviews) {
+        [subview removeFromSuperview];
+    }
+    
+    NSLog(@"Presenting video view in main library window.");
+    
+    VLCVoutView *videoView = self.videoView;
+    videoView.translatesAutoresizingMaskIntoConstraints = NO;
+    videoView.hidden = NO;
+    
+    [_libraryTargetView addSubview:videoView];
+    NSDictionary *dict = NSDictionaryOfVariableBindings(videoView);
+    [_libraryTargetView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[videoView(>=572.)]|"
+                                                                               options:0
+                                                                               metrics:0
+                                                                                 views:dict]];
+    [_libraryTargetView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[videoView(>=444.)]|"
+                                                                               options:0
+                                                                               metrics:0
+                                                                                 views:dict]];
+}
 
-    [self.videoView setHidden:NO];
+- (void)enableVideoPlaybackAppearance
+{
+    [self presentVideoView];
 
     [self.segmentedTitleControl setHidden:YES];
     [self.forwardsNavigationButton setHidden:YES];
@@ -936,7 +949,6 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
 
     // restore alpha value to 1 for the case that macosx-opaqueness is set to < 1
     [self setAlphaValue:1.0];
-    [self.videoView setHidden:YES];
 
     [self.segmentedTitleControl setHidden:NO];
     [self.forwardsNavigationButton setHidden:NO];



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

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