Commit c72e8c36 authored by Felix Paul Kühne's avatar Felix Paul Kühne

unify menu button on the phone form factor

parent 9bf7a6a7
......@@ -13,4 +13,5 @@
@interface UIBarButtonItem (Theme)
+ (UIBarButtonItem *)themedDoneButtonWithTarget:(id)target andSelector:(SEL)selector;
+ (UIBarButtonItem *)themedBackButtonWithTarget:(id)target andSelector:(SEL)selector;
+ (UIBarButtonItem *)themedRevealMenuButtonWithTarget:(id)target andSelector:(SEL)selector;
@end
......@@ -45,4 +45,12 @@
return backButton;
}
+ (UIBarButtonItem *)themedRevealMenuButtonWithTarget:(id)target andSelector:(SEL)selector
{
UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"menuCone"] style:UIBarButtonItemStyleBordered target:target action:selector];
[menuButton setBackgroundImage:[UIImage imageNamed:@"button"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[menuButton setBackgroundImage:[UIImage imageNamed:@"buttonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
return menuButton;
}
@end
......@@ -26,7 +26,7 @@
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
self.navigationItem.rightBarButtonItem = contributeButton;
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedBackButtonWithTarget:self andSelector:@selector(goBack:)];
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
} else
self.navigationItem.leftBarButtonItem = contributeButton;
......
......@@ -23,6 +23,7 @@
NSString *_currentPath;
UIBarButtonItem *_backButton;
UIBarButtonItem *_backToMenuButton;
UIBarButtonItem *_numberOfFilesBarButtonItem;
UIBarButtonItem *_progressBarButtonItem;
......@@ -54,8 +55,9 @@
self.navigationItem.titleView.contentMode = UIViewContentModeScaleAspectFit;
_backButton = [UIBarButtonItem themedBackButtonWithTarget:self andSelector:@selector(goBack:)];
_backToMenuButton = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
self.navigationItem.leftBarButtonItem = _backButton;
self.navigationItem.leftBarButtonItem = _backToMenuButton;
self.tableView.rowHeight = [VLCDropboxTableViewCell heightOfCell];
self.tableView.separatorColor = [UIColor colorWithWhite:.122 alpha:1.];
......@@ -116,7 +118,9 @@
[_dropboxController requestDirectoryListingAtPath:_currentPath];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
self.navigationItem.leftBarButtonItem = ![_currentPath isEqualToString:@"/"]? _backButton: nil;
self.navigationItem.leftBarButtonItem = ![_currentPath isEqualToString:@"/"] ? _backButton : nil;
else
self.navigationItem.leftBarButtonItem = ![_currentPath isEqualToString:@"/"] ? _backButton : _backToMenuButton;
}
#pragma mark - interface interaction
......
......@@ -27,7 +27,7 @@
[self.downloadButton setTitle:NSLocalizedString(@"BUTTON_DOWNLOAD",@"") forState:UIControlStateNormal];
_currentDownloads = [[NSMutableArray alloc] init];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedBackButtonWithTarget:self andSelector:@selector(goBack:)];
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
self.title = NSLocalizedString(@"DOWNLOAD_FROM_HTTP", @"");
[super viewDidLoad];
}
......
......@@ -38,7 +38,7 @@
self.title = NSLocalizedString(@"OPEN_NETWORK", @"");
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedBackButtonWithTarget:self andSelector:@selector(goBack:)];
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
}
- (void)viewWillAppear:(BOOL)animated
......
......@@ -17,6 +17,7 @@
#import "NSString+SupportedMedia.h"
#import "VLCBugreporter.h"
#import "VLCAppDelegate.h"
#import "UIBarButtonItem+Theme.h"
@implementation EmptyLibraryView
@end
......@@ -54,9 +55,7 @@
{
[super viewDidLoad];
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"menuCone"] style:UIBarButtonItemStyleBordered target:self action:@selector(leftButtonAction:)];
[addButton setBackgroundImage:[UIImage imageNamed:@"button"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[addButton setBackgroundImage:[UIImage imageNamed:@"buttonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
UIBarButtonItem *addButton = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(leftButtonAction:)];
/* After day 354 of the year, the usual VLC cone is replaced by another cone
* wearing a Father Xmas hat.
......
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