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

macosx: Use library window method to show/hide loading overlay view in home view controller


Signed-off-by: default avatarClaudio Cambra <developer@claudiocambra.com>
parent 37dcce74
No related branches found
Tags 3.1.5
1 merge request!6136macosx: Unify handling of various view's presentation
......@@ -241,27 +241,10 @@
}
[_ongoingLongLoadingNotifications addObject:notification.name];
if ([self.libraryTargetView.subviews containsObject:self.loadingOverlayView]) {
return;
}
if (self.connected) {
[self.stackViewController disconnectContainers];
}
self.loadingOverlayView.wantsLayer = YES;
self.loadingOverlayView.alphaValue = 0.0;
NSArray * const views = [self.libraryTargetView.subviews arrayByAddingObject:self.loadingOverlayView];
self.libraryTargetView.subviews = views;
[self.libraryTargetView addConstraints:self.libraryWindow.loadingOverlayViewConstraints];
[NSAnimationContext runAnimationGroup:^(NSAnimationContext * const context) {
context.duration = 0.5;
self.loadingOverlayView.animator.alphaValue = 1.0;
} completionHandler:nil];
[self.loadingOverlayView.indicator startAnimation:self];
[self.libraryWindow showLoadingOverlay];
}
- (void)libraryModelLongLoadFinished:(NSNotification *)notification
......@@ -270,28 +253,10 @@
if (_ongoingLongLoadingNotifications.count > 0) {
return;
}
if (![self.libraryTargetView.subviews containsObject:self.loadingOverlayView]) {
return;
}
if (self.connected) {
[self.stackViewController connectContainers];
}
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.libraryWindow.loadingOverlayViewConstraints];
NSMutableArray * const views = self.libraryTargetView.subviews.mutableCopy;
[views removeObject:self.loadingOverlayView];
self.libraryTargetView.subviews = views.copy;
[self.loadingOverlayView.indicator stopAnimation:self];
}];
[self.libraryWindow hideLoadingOverlay];
}
- (void)connect
......
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