Skip to content
Snippets Groups Projects
Commit b45d33d9 authored by Claudio Cambra's avatar Claudio Cambra Committed by Steve Lhomme
Browse files

macosx: Use library window's loading overlay view in playlist view controller


Signed-off-by: default avatarClaudio Cambra <developer@claudiocambra.com>
parent 35b23d05
No related branches found
No related tags found
1 merge request!6136macosx: Unify handling of various view's presentation
......@@ -44,8 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (readonly) VLCLibraryTableView *detailTableView;
@property (readonly) NSScrollView *collectionViewScrollView;
@property (readonly) NSCollectionView *collectionView;
@property (readonly) VLCLoadingOverlayView *loadingOverlayView;
@property (readonly) NSArray<NSLayoutConstraint *> *loadingOverlayViewConstraints;
@property (readonly, weak) VLCLoadingOverlayView *loadingOverlayView;
@property (readonly) VLCLibraryPlaylistDataSource *dataSource;
@property (readonly) VLCLibraryCollectionViewDelegate *collectionViewDelegate;
......
......@@ -61,6 +61,7 @@
if (self) {
_dataSource = [[VLCLibraryPlaylistDataSource alloc] init];
_loadingOverlayView = libraryWindow.loadingOverlayView;
[self setupPlaylistCollectionView];
[self setupPlaylistTableView];
......@@ -214,42 +215,6 @@
];
}
- (void)setupLoadingOverlayView
{
_loadingOverlayView = [[VLCLoadingOverlayView alloc] init];
self.loadingOverlayView.translatesAutoresizingMaskIntoConstraints = NO;
_loadingOverlayViewConstraints = @[
[NSLayoutConstraint constraintWithItem:self.loadingOverlayView
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:self.libraryTargetView
attribute:NSLayoutAttributeTop
multiplier:1
constant:0],
[NSLayoutConstraint constraintWithItem:self.loadingOverlayView
attribute:NSLayoutAttributeRight
relatedBy:NSLayoutRelationEqual
toItem:self.libraryTargetView
attribute:NSLayoutAttributeRight
multiplier:1
constant:0],
[NSLayoutConstraint constraintWithItem:self.loadingOverlayView
attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual
toItem:self.libraryTargetView
attribute:NSLayoutAttributeBottom
multiplier:1
constant:0],
[NSLayoutConstraint constraintWithItem:self.loadingOverlayView
attribute:NSLayoutAttributeLeft
relatedBy:NSLayoutRelationEqual
toItem:self.libraryTargetView
attribute:NSLayoutAttributeLeft
multiplier:1
constant:0]
];
}
- (NSArray<NSLayoutConstraint *> *)placeholderImageViewSizeConstraints
{
return _internalPlaceholderImageViewSizeConstraints;
......@@ -384,7 +349,7 @@
NSArray * const views = [self.libraryTargetView.subviews arrayByAddingObject:self.loadingOverlayView];
self.libraryTargetView.subviews = views;
[self.libraryTargetView addConstraints:_loadingOverlayViewConstraints];
[self.libraryTargetView addConstraints:self.libraryWindow.loadingOverlayViewConstraints];
[NSAnimationContext runAnimationGroup:^(NSAnimationContext * const context) {
context.duration = 0.5;
......@@ -410,7 +375,7 @@
context.duration = 1.0;
self.loadingOverlayView.animator.alphaValue = 0.0;
} completionHandler:^{
[self.libraryTargetView removeConstraints:_loadingOverlayViewConstraints];
[self.libraryTargetView removeConstraints:self.libraryWindow.loadingOverlayViewConstraints];
NSMutableArray * const views = self.libraryTargetView.subviews.mutableCopy;
[views removeObject:self.loadingOverlayView];
self.libraryTargetView.subviews = views.copy;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment