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

macosx: Add method to hide loading overlay in library window


Signed-off-by: default avatarClaudio Cambra <developer@claudiocambra.com>
parent 7301a852
No related branches found
Tags 3.1.5
1 merge request!6136macosx: Unify handling of various view's presentation
...@@ -135,6 +135,7 @@ extern const NSUserInterfaceItemIdentifier VLCLibraryWindowIdentifier; ...@@ -135,6 +135,7 @@ extern const NSUserInterfaceItemIdentifier VLCLibraryWindowIdentifier;
- (void)updateFilterString; - (void)updateFilterString;
- (void)clearFilterString; - (void)clearFilterString;
- (void)showLoadingOverlay; - (void)showLoadingOverlay;
- (void)hideLoadingOverlay;
- (void)presentLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem; - (void)presentLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem;
- (void)goToLocalFolderMrl:(NSString *)mrl; - (void)goToLocalFolderMrl:(NSString *)mrl;
......
...@@ -802,6 +802,27 @@ static void addShadow(NSImageView *__unsafe_unretained imageView) ...@@ -802,6 +802,27 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
} }
- (void)hideLoadingOverlay
{
if (![self.libraryTargetView.subviews containsObject:self.loadingOverlayView]) {
return;
}
self.loadingOverlayView.wantsLayer = YES;
self.loadingOverlayView.alphaValue = 1.0;
[NSAnimationContext runAnimationGroup:^(NSAnimationContext * const context) {
context.duration = 1.0;
self.loadingOverlayView.animator.alphaValue = 0.0;
} completionHandler:^{
[self.libraryTargetView removeConstraints:self.loadingOverlayViewConstraints];
NSMutableArray * const views = self.libraryTargetView.subviews.mutableCopy;
[views removeObject:self.loadingOverlayView];
self.libraryTargetView.subviews = views.copy;
[self.loadingOverlayView.indicator stopAnimation:self];
}];
}
- (void)mouseMoved:(NSEvent *)o_event - (void)mouseMoved:(NSEvent *)o_event
{ {
if (!self.videoViewController.view.hidden) { if (!self.videoViewController.view.hidden) {
......
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