Skip to content
Snippets Groups Projects
Commit bc0ae475 authored by Claudio Cambra's avatar Claudio Cambra Committed by Felix Paul Kühne
Browse files

macosx: Respond to data source notifications and update placeholder label visibility


Signed-off-by: default avatarClaudio Cambra <developer@claudiocambra.com>
parent ecdd5a93
Branches master
No related tags found
No related merge requests found
Pipeline #422480 passed with stage
in 1 minute and 55 seconds
......@@ -23,6 +23,7 @@
#import "VLCLibraryMediaSourceViewController.h"
#import "VLCMediaSourceBaseDataSource.h"
#import "VLCMediaSourceDataSource.h"
#import "extensions/NSFont+VLCAdditions.h"
#import "extensions/NSString+Helpers.h"
......@@ -46,6 +47,16 @@
[self setupCollectionView];
[self setupMediaSourceLibraryViews];
[self setupPlaceholderLabel];
NSNotificationCenter * const defaultCenter = NSNotificationCenter.defaultCenter;
[defaultCenter addObserver:self
selector:@selector(updatePlaceholderLabel:)
name:VLCMediaSourceBaseDataSourceNodeChanged
object:nil];
[defaultCenter addObserver:self
selector:@selector(updatePlaceholderLabel:)
name:VLCMediaSourceDataSourceNodeChanged
object:nil];
}
return self;
}
......@@ -128,6 +139,12 @@
[self.placeholderLabel.centerXAnchor constraintEqualToAnchor:self.mediaSourceView.centerXAnchor],
[self.placeholderLabel.centerYAnchor constraintEqualToAnchor:self.mediaSourceView.centerYAnchor],
]];
[self updatePlaceholderLabel:nil];
}
- (void)updatePlaceholderLabel:(NSNotification *)notification
{
self.placeholderLabel.hidden = self.mediaSourceTableView.numberOfRows > 0;
}
- (void)presentBrowseView
......
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