Commit 13bf28e9 authored by Romain Goyet's avatar Romain Goyet Committed by Felix Paul Kühne

Factorisate the display of a ViewController from the menu

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 2225db4f
......@@ -31,6 +31,7 @@
VLCHTTPDownloadViewController *_downloadViewController;
Reachability *_reachability;
}
- (void)_presentViewController:(UIViewController *)viewController;
@end
@implementation VLCMenuViewController
......@@ -123,14 +124,7 @@
- (IBAction)openAboutPanel:(id)sender
{
UIViewController *aboutController = [[VLCAboutViewController alloc] initWithNibName:nil bundle:nil];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:aboutController];
[navController loadTheme];
[self presentModalViewController:navController animated:YES];
} else {
[self.navigationController pushViewController:aboutController animated:YES];
}
[self _presentViewController:aboutController];
}
- (IBAction)openNetworkStream:(id)sender
......@@ -218,4 +212,16 @@
[self presentModalViewController:navController animated:YES];
}
#pragma mark - Private methods
- (void)_presentViewController:(UIViewController *)viewController
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
[navController loadTheme];
[self presentModalViewController:navController animated:YES];
} else {
[self.navigationController pushViewController:viewController animated:YES];
}
}
@end
......@@ -298,7 +298,7 @@
if (self.menuViewController == nil) {
VLCMenuViewController *menuViewController = [[VLCMenuViewController alloc] initWithNibName:nil bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:menuViewController];
[navigationController loadTheme],
[navigationController loadTheme];
self.menuViewController = navigationController;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
navigationController.navigationBarHidden = 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