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

macosx: Set up loading overlay view and its constraints in library window


Signed-off-by: default avatarClaudio Cambra <developer@claudiocambra.com>
parent 72b71432
No related branches found
No related tags found
1 merge request!6136macosx: Unify handling of various view's presentation
......@@ -39,6 +39,7 @@ NS_ASSUME_NONNULL_BEGIN
@class VLCCustomEmptyLibraryBrowseButton;
@class VLCLibraryWindowSplitViewController;
@class VLCLibraryWindowToolbarDelegate;
@class VLCLoadingOverlayView;
@protocol VLCMediaLibraryItemProtocol;
......@@ -113,6 +114,9 @@ extern const NSUserInterfaceItemIdentifier VLCLibraryWindowIdentifier;
@property (nonatomic, readwrite, strong) IBOutlet NSTextField *placeholderLabel;
@property (nonatomic, readwrite, strong) IBOutlet VLCCustomEmptyLibraryBrowseButton *placeholderGoToBrowseButton;
@property (readonly) VLCLoadingOverlayView *loadingOverlayView;
@property (readonly) NSArray<NSLayoutConstraint *> *loadingOverlayViewConstraints;
@property (readwrite, nonatomic) NSInteger librarySegmentType;
@property (readwrite) BOOL nonembedded;
......
......@@ -71,6 +71,7 @@
#import "views/VLCBottomBarView.h"
#import "views/VLCCustomWindowButton.h"
#import "views/VLCDragDropView.h"
#import "views/VLCLoadingOverlayView.h"
#import "views/VLCRoundedCornerTextField.h"
#import "windows/controlsbar/VLCControlsBarCommon.h"
......@@ -186,6 +187,7 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
_libraryMediaSourceViewController = [[VLCLibraryMediaSourceViewController alloc] initWithLibraryWindow:self];
[self setViewForSelectedSegment];
[self setupLoadingOverlayView];
}
- (void)dealloc
......@@ -206,6 +208,42 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
[coder encodeInteger:_librarySegmentType forKey:@"macosx-library-selected-segment"];
}
- (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]
];
}
#pragma mark - misc. user interactions
- (void)updateGridVsListViewModeSegmentedControl
......
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