Commit 335afc73 authored by Felix Paul Kühne's avatar Felix Paul Kühne

De-uglify Done buttons

parent 00b2a329
......@@ -8,12 +8,6 @@
#import "VLCAboutViewController.h"
@interface VLCAboutViewController () {
UIBarButtonItem *_dismissButton;
}
@end
@implementation VLCAboutViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
......@@ -32,12 +26,14 @@
self.aspenVersion.text = [[NSString stringWithFormat:NSLocalizedString(@"VERSION_FORMAT",@""), [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]] stringByAppendingFormat:@" %@", kVLCVersionCodename];
self.vlckitVersion.text = [NSString stringWithFormat:NSLocalizedString(@"BASED_ON_FORMAT",@""),[[VLCLibrary sharedLibrary] version]];
_dismissButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"BUTTON_DONE", @"")
style:UIBarButtonItemStyleBordered
target:self action:@selector(dismiss)];
[_dismissButton setBackgroundImage:[UIImage imageNamed:@"doneButton"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[_dismissButton setBackgroundImage:[UIImage imageNamed:@"doneButtonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
self.navigationItem.rightBarButtonItem = _dismissButton;
UIBarButtonItem *dismissButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"BUTTON_DONE", @"")
style:UIBarButtonItemStyleBordered
target:self
action:@selector(dismiss)];
[dismissButton setBackgroundImage:[UIImage imageNamed:@"doneButton"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[dismissButton setBackgroundImage:[UIImage imageNamed:@"doneButtonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
[dismissButton setTitleTextAttributes:@{UITextAttributeTextShadowColor : [UIColor whiteColor], UITextAttributeTextColor : [UIColor blackColor]} forState:UIControlStateNormal];
self.navigationItem.rightBarButtonItem = dismissButton;
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
......
......@@ -53,6 +53,7 @@
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"BUTTON_DONE", @"") style:UIBarButtonItemStyleBordered target:self action:@selector(dismiss:)];
[addButton setBackgroundImage:[UIImage imageNamed:@"doneButton"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[addButton setBackgroundImage:[UIImage imageNamed:@"doneButtonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
[addButton setTitleTextAttributes:@{UITextAttributeTextShadowColor : [UIColor whiteColor], UITextAttributeTextColor : [UIColor blackColor]} forState:UIControlStateNormal];
self.navigationItem.rightBarButtonItem = addButton;
_backButton = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStyleBordered target:self action:@selector(folderUp:)];
......
......@@ -55,6 +55,8 @@
action:@selector(dismiss:)];
[dismissButton setBackgroundImage:[UIImage imageNamed:@"doneButton"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[dismissButton setBackgroundImage:[UIImage imageNamed:@"doneButtonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
[dismissButton setTitleTextAttributes:@{UITextAttributeTextShadowColor : [UIColor whiteColor], UITextAttributeTextColor : [UIColor blackColor]} forState:UIControlStateNormal];
dismissButton.width = 80.;
self.dismissToolBar.items = @[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil], dismissButton];
......@@ -213,9 +215,11 @@
[navController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navBarBackgroundPhoneLandscape"] forBarMetrics:UIBarMetricsLandscapePhone];
[self presentModalViewController:navController animated:YES];
[self.settingsViewController.navigationItem.rightBarButtonItem setBackgroundImage:[UIImage imageNamed:@"doneButton"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[self.settingsViewController.navigationItem.rightBarButtonItem setBackgroundImage:[UIImage imageNamed:@"doneButtonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
self.settingsViewController.navigationItem.rightBarButtonItem.style = UIBarButtonItemStylePlain;
UIBarButtonItem *doneButton = self.settingsViewController.navigationItem.rightBarButtonItem;
[doneButton setBackgroundImage:[UIImage imageNamed:@"doneButton"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[doneButton setBackgroundImage:[UIImage imageNamed:@"doneButtonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
doneButton.style = UIBarButtonItemStyleBordered;
[doneButton setTitleTextAttributes:@{UITextAttributeTextShadowColor : [UIColor whiteColor], UITextAttributeTextColor : [UIColor blackColor]} forState:UIControlStateNormal];
}
- (NSString *)_currentIPAddress
......
......@@ -252,13 +252,15 @@
{
[super setEditing:editing animated:animated];
UIBarButtonItem *editButton = self.editButtonItem;
NSString *editImage = editing? @"doneButton": @"button";
NSString *editImageHighlight = editing? @"doneButtonHighlight": @"buttonHighlight";
[self.editButtonItem setBackgroundImage:[UIImage imageNamed:editImage] forState:UIControlStateNormal
[editButton setBackgroundImage:[UIImage imageNamed:editImage] forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
[self.editButtonItem setBackgroundImage:[UIImage imageNamed:editImageHighlight]
[editButton setBackgroundImage:[UIImage imageNamed:editImageHighlight]
forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
[editButton setTitleTextAttributes: editing ? @{UITextAttributeTextShadowColor : [UIColor whiteColor], UITextAttributeTextColor : [UIColor blackColor]} : @{UITextAttributeTextShadowColor : [UIColor colorWithWhite:0. alpha:.37], UITextAttributeTextColor : [UIColor whiteColor]} forState:UIControlStateNormal];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
[self.gridView setEditing:editing];
else
......
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