[vlc-commits] [Git][videolan/vlc][master] macosx: Add a smaller, song-specific table cell for album views

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Aug 5 16:13:26 UTC 2022



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


Commits:
77249644 by Claudio Cambra at 2022-08-05T14:50:13+00:00
macosx: Add a smaller, song-specific table cell for album views

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

- - - - -


11 changed files:

- modules/gui/macosx/Makefile.am
- modules/gui/macosx/UI/VLCLibraryCollectionViewAlbumSupplementaryDetailView.xib
- + modules/gui/macosx/UI/VLCLibrarySongTableCellView.xib
- modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
- modules/gui/macosx/library/VLCLibraryAlbumTracksDataSource.h
- modules/gui/macosx/library/VLCLibraryAlbumTracksDataSource.m
- modules/gui/macosx/library/VLCLibraryCollectionViewAlbumSupplementaryDetailView.m
- + modules/gui/macosx/library/VLCLibrarySongTableCellView.h
- + modules/gui/macosx/library/VLCLibrarySongTableCellView.m
- modules/gui/macosx/views/VLCTrackingView.h
- modules/gui/macosx/views/VLCTrackingView.m


Changes:

=====================================
modules/gui/macosx/Makefile.am
=====================================
@@ -84,6 +84,8 @@ libmacosx_plugin_la_SOURCES = \
 	gui/macosx/library/VLCLibraryNavigationStack.m \
 	gui/macosx/library/VLCLibraryNavigationState.h \
 	gui/macosx/library/VLCLibraryNavigationState.m \
+	gui/macosx/library/VLCLibrarySongTableCellView.h \
+	gui/macosx/library/VLCLibrarySongTableCellView.m \
 	gui/macosx/library/VLCLibrarySortingMenuController.h \
 	gui/macosx/library/VLCLibrarySortingMenuController.m \
 	gui/macosx/library/VLCLibraryTableCellView.h \
@@ -306,6 +308,7 @@ libmacosx_plugin_la_XIB_SOURCES = \
 	gui/macosx/UI/VLCPlaylistTableCellView.xib \
 	gui/macosx/UI/VLCLibraryCollectionViewItem.xib \
 	gui/macosx/UI/VLCLibraryCollectionViewAlbumSupplementaryDetailView.xib \
+	gui/macosx/UI/VLCLibrarySongTableCellView.xib \
 	gui/macosx/UI/VLCMediaSourceCollectionViewItem.xib \
 	gui/macosx/UI/VLCMediaSourceDeviceCollectionViewItem.xib \
 	gui/macosx/UI/VLCInformationWindow.xib \


=====================================
modules/gui/macosx/UI/VLCLibraryCollectionViewAlbumSupplementaryDetailView.xib
=====================================
@@ -115,7 +115,7 @@
                                         <rect key="frame" x="0.0" y="0.0" width="701" height="198"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                         <subviews>
-                                            <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="50" viewBased="YES" id="eEJ-WA-0aM">
+                                            <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="fullWidth" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="50" viewBased="YES" id="eEJ-WA-0aM">
                                                 <rect key="frame" x="0.0" y="0.0" width="701" height="198"/>
                                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                 <size key="intercellSpacing" width="3" height="2"/>
@@ -123,7 +123,7 @@
                                                 <tableViewGridLines key="gridStyleMask" horizontal="YES"/>
                                                 <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
                                                 <tableColumns>
-                                                    <tableColumn editable="NO" width="669" minWidth="10" maxWidth="1000" id="tVn-dP-rPg">
+                                                    <tableColumn editable="NO" width="689" minWidth="10" maxWidth="1000" id="tVn-dP-rPg">
                                                         <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
                                                             <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
                                                             <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
@@ -136,7 +136,7 @@
                                                         <tableColumnResizingMask key="resizingMask" resizeWithTable="YES"/>
                                                         <prototypeCellViews>
                                                             <tableCellView id="vmz-MH-Uum">
-                                                                <rect key="frame" x="11" y="1" width="678" height="24"/>
+                                                                <rect key="frame" x="1" y="1" width="698" height="36"/>
                                                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                             </tableCellView>
                                                         </prototypeCellViews>


=====================================
modules/gui/macosx/UI/VLCLibrarySongTableCellView.xib
=====================================
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="20037" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="20037"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="VLCPlaylistTableCellView"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe" customClass="VLCLibrarySongTableCellView">
+            <rect key="frame" x="0.0" y="0.0" width="398" height="50"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="ffE-px-l0g" customClass="VLCTrackingView">
+                    <rect key="frame" x="0.0" y="0.0" width="398" height="50"/>
+                </customView>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Wzl-zu-AHr">
+                    <rect key="frame" x="8" y="17" width="36" height="16"/>
+                    <constraints>
+                        <constraint firstAttribute="width" relation="lessThanOrEqual" constant="32" id="nu6-8s-Vhh"/>
+                    </constraints>
+                    <textFieldCell key="cell" lineBreakMode="clipping" title="Track number" id="gjj-jC-J6y">
+                        <font key="font" metaFont="system"/>
+                        <color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ohB-P0-nCv">
+                    <rect key="frame" x="50" y="17" width="268" height="16"/>
+                    <textFieldCell key="cell" lineBreakMode="truncatingTail" title="Song name" id="ZPw-XO-XD1">
+                        <font key="font" usesAppearanceFont="YES"/>
+                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="NFZ-x0-t5c">
+                    <rect key="frame" x="10" y="7" width="12" height="36"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="32" id="bai-RH-huE"/>
+                    </constraints>
+                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="play.fill" catalog="system" imagePosition="only" alignment="left" imageScaling="proportionallyDown" inset="2" id="5MR-Gt-X4p">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                    </buttonCell>
+                    <color key="contentTintColor" red="1" green="0.38123786450000002" blue="0.039215686270000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                </button>
+                <textField horizontalHuggingPriority="1000" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="XNL-fH-9bU">
+                    <rect key="frame" x="334" y="17" width="56" height="16"/>
+                    <textFieldCell key="cell" lineBreakMode="clipping" title="Duration" id="5xs-R6-nqu">
+                        <font key="font" usesAppearanceFont="YES"/>
+                        <color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+            </subviews>
+            <constraints>
+                <constraint firstItem="ohB-P0-nCv" firstAttribute="trailing" secondItem="XNL-fH-9bU" secondAttribute="leading" constant="-20" id="8Vs-Dy-2RI"/>
+                <constraint firstItem="Wzl-zu-AHr" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="10" id="E8L-qx-YEb"/>
+                <constraint firstItem="ffE-px-l0g" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="EMs-It-nUH"/>
+                <constraint firstItem="XNL-fH-9bU" firstAttribute="trailing" secondItem="ffE-px-l0g" secondAttribute="trailing" constant="-10" id="Ea2-S4-L6B"/>
+                <constraint firstAttribute="bottom" secondItem="ffE-px-l0g" secondAttribute="bottom" id="I7D-8N-oA1"/>
+                <constraint firstItem="ohB-P0-nCv" firstAttribute="centerY" secondItem="c22-O7-iKe" secondAttribute="centerY" id="JWS-cd-lGO"/>
+                <constraint firstItem="ffE-px-l0g" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="M01-2i-CLZ"/>
+                <constraint firstItem="NFZ-x0-t5c" firstAttribute="leading" secondItem="Wzl-zu-AHr" secondAttribute="leading" id="Srq-fm-Owt"/>
+                <constraint firstItem="NFZ-x0-t5c" firstAttribute="centerY" secondItem="c22-O7-iKe" secondAttribute="centerY" id="bhc-Wp-rhJ"/>
+                <constraint firstItem="XNL-fH-9bU" firstAttribute="centerY" secondItem="c22-O7-iKe" secondAttribute="centerY" id="deD-eW-OHk"/>
+                <constraint firstItem="ohB-P0-nCv" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="52" id="fC0-Qy-VzP"/>
+                <constraint firstItem="NFZ-x0-t5c" firstAttribute="leading" secondItem="ffE-px-l0g" secondAttribute="leading" constant="10" id="laI-Bm-0fz"/>
+                <constraint firstAttribute="trailing" secondItem="ffE-px-l0g" secondAttribute="trailing" id="m4c-HB-V5e"/>
+                <constraint firstItem="Wzl-zu-AHr" firstAttribute="centerY" secondItem="c22-O7-iKe" secondAttribute="centerY" id="rwm-3K-L1o"/>
+            </constraints>
+            <connections>
+                <outlet property="durationTextField" destination="XNL-fH-9bU" id="hm1-P0-Lec"/>
+                <outlet property="playInstantlyButton" destination="NFZ-x0-t5c" id="suD-1u-UrY"/>
+                <outlet property="songNameTextField" destination="ohB-P0-nCv" id="gBJ-WZ-6pB"/>
+                <outlet property="trackNumberTextField" destination="Wzl-zu-AHr" id="gjW-p3-Mg1"/>
+                <outlet property="trackingView" destination="ffE-px-l0g" id="Eme-n5-LGv"/>
+            </connections>
+            <point key="canvasLocation" x="98" y="39.5"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="play.fill" catalog="system" width="12" height="13"/>
+    </resources>
+</document>


=====================================
modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
=====================================
@@ -32,7 +32,6 @@
 #import "library/VLCLibraryAlbumTracksDataSource.h"
 
 NSString *VLCAudioLibraryCellIdentifier = @"VLCAudioLibraryCellIdentifier";
-const CGFloat VLCLibraryTracksRowHeight = 50.;
 const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
 const CGFloat LayoutSpacer;
 


=====================================
modules/gui/macosx/library/VLCLibraryAlbumTracksDataSource.h
=====================================
@@ -28,6 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface VLCLibraryAlbumTracksDataSource : NSObject <NSTableViewDataSource, NSTableViewDelegate>
 
+extern const CGFloat VLCLibraryTracksRowHeight;
+
 @property (readwrite, retain, nonatomic, nullable) VLCMediaLibraryAlbum *representedAlbum;
 
 @end


=====================================
modules/gui/macosx/library/VLCLibraryAlbumTracksDataSource.m
=====================================
@@ -21,7 +21,7 @@
  *****************************************************************************/
 
 #import "VLCLibraryAlbumTracksDataSource.h"
-#import "VLCLibraryAlbumTableCellView.h"
+#import "VLCLibrarySongTableCellView.h"
 #import "extensions/NSFont+VLCAdditions.h"
 #import "extensions/NSString+Helpers.h"
 #import "views/VLCImageView.h"
@@ -32,6 +32,8 @@
 #import "library/VLCLibraryTableCellView.h"
 #import "library/VLCLibraryAlbumTracksDataSource.h"
 
+const CGFloat VLCLibraryTracksRowHeight = 40.;
+
 @interface VLCLibraryAlbumTracksDataSource ()
 {
     NSArray *_tracks;
@@ -57,11 +59,11 @@
 
 - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
 {
-    VLCLibraryTableCellView *cellView = [tableView makeViewWithIdentifier:VLCAudioLibraryCellIdentifier owner:self];
+    VLCLibrarySongTableCellView *cellView = [tableView makeViewWithIdentifier:VLCAudioLibrarySongCellIdentifier owner:self];
 
     if (cellView == nil) {
         /* the following code saves us an instance of NSViewController which we don't need */
-        NSNib *nib = [[NSNib alloc] initWithNibNamed:@"VLCLibraryTableCellView" bundle:nil];
+        NSNib *nib = [[NSNib alloc] initWithNibNamed:@"VLCLibrarySongTableCellView" bundle:nil];
         NSArray *topLevelObjects;
         if (![nib instantiateWithOwner:self topLevelObjects:&topLevelObjects]) {
             NSAssert(1, @"Failed to load nib file to show audio library items");
@@ -69,15 +71,15 @@
         }
 
         for (id topLevelObject in topLevelObjects) {
-            if ([topLevelObject isKindOfClass:[VLCLibraryTableCellView class]]) {
+            if ([topLevelObject isKindOfClass:[VLCLibrarySongTableCellView class]]) {
                 cellView = topLevelObject;
                 break;
             }
         }
-        cellView.identifier = VLCAudioLibraryCellIdentifier;
+        cellView.identifier = VLCAudioLibrarySongCellIdentifier;
     }
 
-    [cellView setRepresentedItem:_tracks[row]];
+    cellView.representedMediaItem = _tracks[row];
     return cellView;
 }
 


=====================================
modules/gui/macosx/library/VLCLibraryCollectionViewAlbumSupplementaryDetailView.m
=====================================
@@ -60,6 +60,8 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewAlbumSupp
     _tracksDataSource = [[VLCLibraryAlbumTracksDataSource alloc] init];
     _albumTracksTableView.dataSource = _tracksDataSource;
     _albumTracksTableView.delegate = _tracksDataSource;
+    _albumTracksTableView.rowHeight = VLCLibraryTracksRowHeight;
+    
     _albumTitleTextField.font = [NSFont VLCLibrarySupplementaryDetailViewTitleFont];
     _albumDetailsTextField.font = [ NSFont VLCLibrarySupplementaryDetailViewSubtitleFont];
     _albumDetailsTextField.textColor = [NSColor VLCOrangeElementColor];


=====================================
modules/gui/macosx/library/VLCLibrarySongTableCellView.h
=====================================
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * VLCLibrarySongTableCellView.h: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2022 VLC authors and VideoLAN
+ *
+ * Authors: Claudio Cambra <claudio.cambra at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import <Cocoa/Cocoa.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+ at class VLCTrackingView;
+ at class VLCMediaLibraryItem;
+
+ at interface VLCLibrarySongTableCellView : NSTableCellView
+
+extern NSString *VLCAudioLibrarySongCellIdentifier;
+
+ at property (readwrite, assign) IBOutlet VLCTrackingView *trackingView;
+ at property (readwrite, assign) IBOutlet NSTextField *songNameTextField;
+ at property (readwrite, assign) IBOutlet NSTextField *durationTextField;
+ at property (readwrite, assign) IBOutlet NSTextField *trackNumberTextField;
+ at property (readwrite, assign) IBOutlet NSButton *playInstantlyButton;
+
+ at property (readwrite, assign, nonatomic) VLCMediaLibraryItem *representedMediaItem;
+
+- (IBAction)playInstantly:(id)sender;
+
+ at end
+
+NS_ASSUME_NONNULL_END
\ No newline at end of file


=====================================
modules/gui/macosx/library/VLCLibrarySongTableCellView.m
=====================================
@@ -0,0 +1,87 @@
+/*****************************************************************************
+ * VLCLibrarySongTableCellView.m: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2022 VLC authors and VideoLAN
+ *
+ * Authors: Claudio Cambra <claudio.cambra at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import "VLCLibrarySongTableCellView.h"
+#import "extensions/NSFont+VLCAdditions.h"
+#import "extensions/NSString+Helpers.h"
+#import "views/VLCImageView.h"
+#import "views/VLCTrackingView.h"
+#import "main/VLCMain.h"
+#import "library/VLCLibraryController.h"
+#import "library/VLCLibraryDataTypes.h"
+#import "library/VLCLibraryTableCellView.h"
+#import "library/VLCLibraryAlbumTracksDataSource.h"
+
+NSString *VLCAudioLibrarySongCellIdentifier = @"VLCAudioLibrarySongCellIdentifier";
+
+ at interface VLCLibrarySongTableCellView ()
+{
+    VLCLibraryController *_libraryController;
+}
+ at end
+
+ at implementation VLCLibrarySongTableCellView
+
+- (void)awakeFromNib
+{
+    self.playInstantlyButton.target = self;
+    self.playInstantlyButton.action = @selector(playInstantly:);
+
+    self.trackingView.viewToHide = self.playInstantlyButton;
+    self.trackingView.viewToShow = self.trackNumberTextField;
+    [self prepareForReuse];
+}
+
+- (void)prepareForReuse
+{
+    [super prepareForReuse];
+    self.songNameTextField.stringValue = @"";
+    self.durationTextField.stringValue = @"";
+    self.trackNumberTextField.stringValue = @"";
+    self.playInstantlyButton.hidden = YES;
+    self.trackNumberTextField.hidden = NO;
+}
+
+- (IBAction)playInstantly:(id)sender
+{
+    if(_representedMediaItem == nil) {
+        return;
+    }
+
+    if (!_libraryController) {
+        _libraryController = [[VLCMain sharedInstance] libraryController];
+    }
+
+    BOOL playImmediately = YES;
+    [_libraryController appendItemToPlaylist:_representedMediaItem playImmediately:playImmediately];
+}
+
+- (void)setRepresentedMediaItem:(VLCMediaLibraryMediaItem *)representedMediaItem
+{
+    _representedMediaItem = representedMediaItem;
+    self.songNameTextField.stringValue = representedMediaItem.displayString;
+    self.durationTextField.stringValue = representedMediaItem.durationString;
+    self.trackNumberTextField.stringValue = [NSString stringWithFormat:@"%d", representedMediaItem.trackNumber];
+
+}
+
+ at end


=====================================
modules/gui/macosx/views/VLCTrackingView.h
=====================================
@@ -28,6 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (readwrite) BOOL animatesTransition;
 @property (readwrite, assign, nullable) NSView *viewToHide;
+ at property (readwrite, assign, nullable) NSView *viewToShow;
 
 @end
 


=====================================
modules/gui/macosx/views/VLCTrackingView.m
=====================================
@@ -34,15 +34,22 @@
 {
     if (self.animatesTransition) {
         [self.viewToHide setAlphaValue:1.0];
+        [self.viewToShow setAlphaValue:.0];
+        [self.viewToShow setHidden:NO];
+
         __weak typeof(self.viewToHide) weakViewToHide = self.viewToHide;
+        __weak typeof(self.viewToShow) weakViewToShow = self.viewToShow;
+
         [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
             [[NSAnimationContext currentContext] setDuration:0.9];
             [[weakViewToHide animator] setAlphaValue:0.0];
+            [[weakViewToShow animator] setAlphaValue:1.0];
         } completionHandler:^{
             [weakViewToHide setHidden:YES];
         }];
     } else {
         self.viewToHide.hidden = YES;
+        self.viewToShow.hidden = NO;
     }
 }
 
@@ -51,13 +58,20 @@
     if (self.animatesTransition) {
         [self.viewToHide setAlphaValue:.0];
         [self.viewToHide setHidden:NO];
+
         __weak typeof(self.viewToHide) weakViewToHide = self.viewToHide;
+        __weak typeof(self.viewToShow) weakViewToShow = self.viewToShow;
+
         [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
             [[NSAnimationContext currentContext] setDuration:0.9];
             [[weakViewToHide animator] setAlphaValue:1.0];
-        } completionHandler:nil];
+            [[weakViewToShow animator] setAlphaValue:.0];
+        } completionHandler:^{
+            [weakViewToShow setHidden:YES];
+        }];
     } else {
         self.viewToHide.hidden = NO;
+        self.viewToShow.hidden = YES;
     }
 }
 



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

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