Commit bf0c43ff authored by David Fuhrmann's avatar David Fuhrmann

macosx: Move status bar xib initialization into VLCStatusBarIcon class

parent 0cf313d3
......@@ -96,10 +96,6 @@ int OpenIntf (vlc_object_t *p_this)
[VLCMain sharedInstance];
[NSBundle loadNibNamed:@"MainMenu" owner:[[VLCMain sharedInstance] mainMenu]];
// if statusbar enabled in preferences
if (var_InheritBool(p_intf, "macosx-statusicon")) {
[NSBundle loadNibNamed:@"VLCStatusBarIconMainMenu" owner:[[VLCMain sharedInstance] statusBarIcon]];
}
[[[VLCMain sharedInstance] mainWindow] makeKeyAndOrderFront:nil];
msg_Dbg(p_intf, "Finished loading macosx interface");
......@@ -230,11 +226,7 @@ static VLCMain *sharedInstance = nil;
_coredialogs = [[VLCCoreDialogProvider alloc] init];
_mainmenu = [[VLCMainMenu alloc] init];
// if statusbar enabled in preferences
if (var_InheritBool(p_intf, "macosx-statusicon")) {
_statusBarIcon = [[VLCStatusBarIcon alloc] init];
}
_statusBarIcon = [[VLCStatusBarIcon alloc] init];
_voutController = [[VLCVoutWindowController alloc] init];
_playlist = [[VLCPlaylist alloc] init];
......
......@@ -73,6 +73,19 @@
#pragma mark -
#pragma mark Init
- (instancetype)init
{
self = [super init];
if (self) {
msg_Dbg(getIntf(), "Loading VLCStatusBarIcon");
[NSBundle loadNibNamed:@"VLCStatusBarIconMainMenu" owner:self];
}
return self;
}
- (void)awakeFromNib
{
[super awakeFromNib];
......@@ -115,6 +128,9 @@
*/
- (void)enableMenuIcon
{
if (!var_InheritBool(getIntf(), "macosx-statusicon"))
return;
// Init the status item
_statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
[_statusItem setHighlightMode:YES];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment