macosx: Move toolbar initialisation routines to library window toolbar delegate

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
Claudio Cambra 2024-04-19 17:55:46 +08:00 committed by Felix Paul Kühne
parent 9abf607408
commit 0558902cd2
2 changed files with 8 additions and 7 deletions

View File

@ -200,13 +200,6 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
_libraryMediaSourceViewController = [[VLCLibraryMediaSourceViewController alloc] initWithLibraryWindow:self];
[self setViewForSelectedSegment];
// Hide renderers toolbar item at first. Start discoveries and wait for notifications about
// renderers being added or removed to keep hidden or show depending on outcome
[self.toolbarDelegate hideToolbarItem:self.toolbarDelegate.renderersToolbarItem];
[VLCMain.sharedInstance.mainMenu.rendererMenuController startRendererDiscoveries];
[self.toolbarDelegate updatePlayqueueToggleState];
}
- (void)dealloc

View File

@ -29,6 +29,7 @@
#import "main/VLCMain.h"
#import "menus/VLCMainMenu.h"
#import "menus/renderers/VLCRendererMenuController.h"
NSString * const VLCLibraryWindowTrackingSeparatorToolbarItemIdentifier = @"VLCLibraryWindowTrackingSeparatorToolbarItemIdentifier";
@ -52,6 +53,13 @@ NSString * const VLCLibraryWindowTrackingSeparatorToolbarItemIdentifier = @"VLCL
self.trackingSeparatorToolbarItem =
[self.toolbar.items objectAtIndex:trackingSeparatorItemIndex];
}
// Hide renderers toolbar item at first. Start discoveries and wait for notifications about
// renderers being added or removed to keep hidden or show depending on outcome
[self hideToolbarItem:self.renderersToolbarItem];
[VLCMain.sharedInstance.mainMenu.rendererMenuController startRendererDiscoveries];
[self updatePlayqueueToggleState];
}
- (IBAction)rendererControlAction:(id)sender