[vlc-commits] [Git][videolan/vlc][master] 5 commits: macosx: Hide path control bar when not needed
Steve Lhomme (@robUx4)
gitlab at videolan.org
Tue Apr 18 14:19:22 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
f444591d by Claudio Cambra at 2023-04-18T13:42:55+00:00
macosx: Hide path control bar when not needed
(i.e. when already at home and path control is empty)
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
c2776a31 by Claudio Cambra at 2023-04-18T13:42:55+00:00
macosx: Add outlet for bottom path control constraints in VLCLibraryWindow
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
54fce01f by Claudio Cambra at 2023-04-18T13:42:55+00:00
macosx: Store reference to path control bottom constraint in media source components
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
6ba3fa42 by Claudio Cambra at 2023-04-18T13:42:55+00:00
macosx: Extract home button and path control hiding into single internal method of VLCMediaSourceBaseDataSource
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
736811e6 by Claudio Cambra at 2023-04-18T13:42:55+00:00
macosx: Fix empty space still being taken up by hidden path control in media source views
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
6 changed files:
- modules/gui/macosx/UI/VLCLibraryWindow.xib
- modules/gui/macosx/library/VLCLibraryWindow.h
- modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.h
- modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.m
- modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.h
- modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
Changes:
=====================================
modules/gui/macosx/UI/VLCLibraryWindow.xib
=====================================
@@ -766,6 +766,8 @@
<outlet property="mediaSourceCollectionViewScrollView" destination="cFG-c9-cI9" id="QQq-Ql-uQ7"/>
<outlet property="mediaSourceHomeButton" destination="jfA-Vr-sQc" id="oLM-NF-rqe"/>
<outlet property="mediaSourcePathControl" destination="Rjk-Q6-FYy" id="G63-NM-Ekn"/>
+ <outlet property="mediaSourcePathControlCollectionViewScrollViewBottomConstraint" destination="Lji-yk-wiI" id="BxP-JG-rlP"/>
+ <outlet property="mediaSourcePathControlTableViewScrollViewBottomConstraint" destination="Xao-NR-Utd" id="GYG-ye-2Rq"/>
<outlet property="mediaSourceTableView" destination="vpJ-Oz-Ebz" id="Hbo-Qw-JQd"/>
<outlet property="mediaSourceTableViewScrollView" destination="7WD-fy-WtJ" id="8As-1W-Af8"/>
<outlet property="mediaSourceView" destination="eHd-Q9-F8D" id="gfU-Jp-eFr"/>
=====================================
modules/gui/macosx/library/VLCLibraryWindow.h
=====================================
@@ -93,6 +93,8 @@ extern const NSUserInterfaceItemIdentifier VLCLibraryWindowIdentifier;
@property (readwrite, weak) IBOutlet NSView *mediaSourceView;
@property (readwrite, weak) IBOutlet NSButton *mediaSourceHomeButton;
@property (readwrite, weak) IBOutlet VLCInputNodePathControl *mediaSourcePathControl;
+ at property (readwrite, weak) IBOutlet NSLayoutConstraint *mediaSourcePathControlTableViewScrollViewBottomConstraint;
+ at property (readwrite, weak) IBOutlet NSLayoutConstraint *mediaSourcePathControlCollectionViewScrollViewBottomConstraint;
@property (readwrite, weak) IBOutlet NSScrollView *mediaSourceTableViewScrollView;
@property (readwrite, weak) IBOutlet NSTableView *mediaSourceTableView;
@property (readwrite, weak) IBOutlet NSScrollView *mediaSourceCollectionViewScrollView;
=====================================
modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.h
=====================================
@@ -39,6 +39,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (readonly) NSScrollView *tableViewScrollView;
@property (readonly) NSButton *homeButton;
@property (readonly) VLCInputNodePathControl *pathControl;
+ at property (readonly) NSLayoutConstraint *pathControlBottomTableViewScrollViewConstraint;
+ at property (readonly) NSLayoutConstraint *pathControlBottomCollectionViewScrollViewConstraint;
@property (readonly) NSSegmentedControl *gridVsListSegmentedControl;
@property (readonly) VLCMediaSourceBaseDataSource *baseDataSource;
=====================================
modules/gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.m
=====================================
@@ -58,6 +58,8 @@
_tableViewScrollView = libraryWindow.mediaSourceTableViewScrollView;
_homeButton = libraryWindow.mediaSourceHomeButton;
_pathControl = libraryWindow.mediaSourcePathControl;
+ _pathControlBottomTableViewScrollViewConstraint = libraryWindow.mediaSourcePathControlTableViewScrollViewBottomConstraint;
+ _pathControlBottomCollectionViewScrollViewConstraint = libraryWindow.mediaSourcePathControlCollectionViewScrollViewBottomConstraint;
_gridVsListSegmentedControl = libraryWindow.gridVsListSegmentedControl;
}
@@ -68,6 +70,8 @@
_baseDataSource.collectionViewScrollView = _collectionViewScrollView;
_baseDataSource.homeButton = _homeButton;
_baseDataSource.pathControl = _pathControl;
+ _baseDataSource.pathControlBottomTableViewScrollViewConstraint = _pathControlBottomTableViewScrollViewConstraint;
+ _baseDataSource.pathControlBottomCollectionViewScrollViewConstraint = _pathControlBottomCollectionViewScrollViewConstraint;
_baseDataSource.tableView = _tableView;
[_baseDataSource setupViews];
}
=====================================
modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.h
=====================================
@@ -43,6 +43,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (readwrite) NSTableView *tableView;
@property (readwrite) NSButton *homeButton;
@property (readwrite) VLCInputNodePathControl *pathControl;
+ at property (readwrite) NSLayoutConstraint *pathControlBottomTableViewScrollViewConstraint;
+ at property (readwrite) NSLayoutConstraint *pathControlBottomCollectionViewScrollViewConstraint;
@property (readwrite, nonatomic) VLCMediaSourceMode mediaSourceMode;
@property (readwrite, nonatomic) VLCMediaSourceDataSource *childDataSource;
=====================================
modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
=====================================
@@ -106,6 +106,8 @@ NSString *VLCMediaSourceTableViewCellIdentifier = @"VLCMediaSourceTableViewCellI
self.pathControl.action = @selector(pathControlAction:);
self.pathControl.target = self;
+ [self togglePathControlVisibility:NO];
+
self.tableView.dataSource = self;
self.tableView.delegate = self;
self.tableView.hidden = YES;
@@ -415,6 +417,8 @@ referenceSizeForHeaderInSection:(NSInteger)section
[self setChildDataSource:newChildDataSource];
[[VLCMain sharedInstance].libraryWindow.navigationStack appendCurrentLibraryState];
+
+ [self togglePathControlVisibility:YES];
}
- (void)setChildDataSource:(VLCMediaSourceDataSource *)childDataSource
@@ -449,6 +453,14 @@ referenceSizeForHeaderInSection:(NSInteger)section
#pragma mark - user interaction with generic buttons
+- (void)togglePathControlVisibility:(BOOL)visible
+{
+ _homeButton.hidden = !visible;
+ _pathControl.hidden = !visible;
+ _pathControlBottomTableViewScrollViewConstraint.constant = visible ? [VLCLibraryUIUnits mediumSpacing] : 0;
+ _pathControlBottomCollectionViewScrollViewConstraint.constant = visible ? [VLCLibraryUIUnits mediumSpacing] : 0;
+}
+
- (void)returnHome
{
self.collectionView.dataSource = self;
@@ -460,6 +472,8 @@ referenceSizeForHeaderInSection:(NSInteger)section
[self.pathControl clearInputNodePathControlItems];
[self reloadData];
+
+ [self togglePathControlVisibility:NO];
}
- (void)homeButtonAction:(id)sender
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/af630c7010ba29431a8a4da9cc24e09ccd06e241...736811e6a3f10cc34397aabefe85b5302d0fc1ef
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/af630c7010ba29431a8a4da9cc24e09ccd06e241...736811e6a3f10cc34397aabefe85b5302d0fc1ef
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