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

macosx: Use library window's displayNoResultsMessage in video view controller


Signed-off-by: default avatarClaudio Cambra <developer@claudiocambra.com>
parent 8f56e470
No related branches found
No related tags found
1 merge request!6136macosx: Unify handling of various view's presentation
......@@ -50,8 +50,6 @@
#import "main/VLCMain.h"
#import "views/VLCNoResultsLabel.h"
#import "windows/video/VLCVoutView.h"
#import "windows/video/VLCMainVideoViewController.h"
......@@ -65,8 +63,6 @@
id<VLCMediaLibraryItemProtocol> _awaitingPresentingLibraryItem;
NSArray<NSLayoutConstraint *> *_internalPlaceholderImageViewSizeConstraints;
VLCNoResultsLabel *_noResultsLabel;
}
@end
......@@ -285,7 +281,7 @@
const VLCLibraryViewModeSegment viewModeSegment = VLCLibraryWindowPersistentPreferences.sharedInstance.videoLibraryViewMode;
[self presentVideoLibraryView:viewModeSegment];
} else if (self.libraryVideoDataSource.libraryModel.filterString.length > 0) {
[self presentNoResultsView];
[self.libraryWindow displayNoResultsMessage];
} else {
[self presentPlaceholderVideoLibraryView];
}
......@@ -312,7 +308,7 @@
const VLCLibraryViewModeSegment viewModeSegment = VLCLibraryWindowPersistentPreferences.sharedInstance.showsLibraryViewMode;
[self presentVideoLibraryView:viewModeSegment];
} else if (self.libraryShowsDataSource.libraryModel.filterString.length > 0) {
[self presentNoResultsView];
[self.libraryWindow displayNoResultsMessage];
} else {
[self presentPlaceholderVideoLibraryView];
}
......@@ -335,25 +331,6 @@
displayingMessage:_NS("Your favorite videos will appear here.\nGo to the Browse section to add videos you love.")];
}
- (void)presentNoResultsView
{
if (_noResultsLabel == nil) {
_noResultsLabel = [[VLCNoResultsLabel alloc] init];
_noResultsLabel.translatesAutoresizingMaskIntoConstraints = NO;
}
if ([self.libraryTargetView.subviews containsObject:self.libraryWindow.loadingOverlayView]) {
self.libraryTargetView.subviews = @[_noResultsLabel, self.libraryWindow.loadingOverlayView];
} else {
self.libraryTargetView.subviews = @[_noResultsLabel];
}
[NSLayoutConstraint activateConstraints:@[
[_noResultsLabel.centerXAnchor constraintEqualToAnchor:self.libraryTargetView.centerXAnchor],
[_noResultsLabel.centerYAnchor constraintEqualToAnchor:self.libraryTargetView.centerYAnchor]
]];
}
- (void)presentVideoLibraryView:(VLCLibraryViewModeSegment)viewModeSegment
{
[self.libraryWindow displayLibraryView:self.videoLibraryView];
......
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