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

macosx: Add method to handle displaying of library views in library window


Signed-off-by: default avatarClaudio Cambra <developer@claudiocambra.com>
parent 49822dbf
No related branches found
No related tags found
1 merge request!6136macosx: Unify handling of various view's presentation
......@@ -137,6 +137,7 @@ extern const NSUserInterfaceItemIdentifier VLCLibraryWindowIdentifier;
- (void)showLoadingOverlay;
- (void)hideLoadingOverlay;
- (void)displayLibraryView:(NSView *)view;
- (void)presentLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem;
- (void)goToLocalFolderMrl:(NSString *)mrl;
......
......@@ -487,6 +487,23 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
_librarySegmentViewController = lvc;
}
- (void)displayLibraryView:(NSView *)view
{
view.translatesAutoresizingMaskIntoConstraints = NO;
if ([self.libraryTargetView.subviews containsObject:self.loadingOverlayView]) {
self.libraryTargetView.subviews = @[view, self.loadingOverlayView];
} else {
self.libraryTargetView.subviews = @[view];
}
[NSLayoutConstraint activateConstraints:@[
[view.topAnchor constraintEqualToAnchor:self.libraryTargetView.topAnchor],
[view.bottomAnchor constraintEqualToAnchor:self.libraryTargetView.bottomAnchor],
[view.leftAnchor constraintEqualToAnchor:self.libraryTargetView.leftAnchor],
[view.rightAnchor constraintEqualToAnchor:self.libraryTargetView.rightAnchor]
]];
}
- (void)presentAudioLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem
{
[self showAudioLibrary];
......
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