Commit 960787b7 authored by Felix Paul Kühne's avatar Felix Paul Kühne

replace rarely used themed done button with a more appealing dark button

no visual difference on iOS 7 and later
parent d35f340e
......@@ -2,21 +2,15 @@
* UIBarButtonItem+Theme.h
* VLC for iOS
*****************************************************************************
* Copyright (c) 2013 VideoLAN. All rights reserved.
* Copyright (c) 2013-2015 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Romain Goyet <romain.goyet # applidium.com>
* Felix Paul Kühne <fkuehne # videolan.org>
* Authors: Felix Paul Kühne <fkuehne # videolan.org>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import <UIKit/UIKit.h>
@interface UIBarButtonItem (Theme)
+ (UIBarButtonItem *)themedDoneButtonWithTarget:(id)target andSelector:(SEL)selector;
@interface UIBarButtonItem (ThemedButtons)
+ (UIBarButtonItem *)themedBackButtonWithTarget:(id)target andSelector:(SEL)selector;
+ (UIBarButtonItem *)themedRevealMenuButtonWithTarget:(id)target andSelector:(SEL)selector;
+ (UIBarButtonItem *)themedDarkToolbarButtonWithTitle: (NSString*) title target:(id)target andSelector:(SEL)selector;
@end
@end
\ No newline at end of file
......@@ -2,39 +2,16 @@
* UIBarButtonItem+Theme.m
* VLC for iOS
*****************************************************************************
* Copyright (c) 2013 VideoLAN. All rights reserved.
* Copyright (c) 2013-2015 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne # videolan.org>
* Romain Goyet <romain.goyet # applidium.com>
* Fabio Ritrovato <sephiroth87 # videolan.org>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import "UIBarButtonItem+Theme.h"
@implementation UIBarButtonItem (Theme)
+ (UIBarButtonItem *)themedDoneButtonWithTarget:(id)target andSelector:(SEL)selector
{
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"BUTTON_DONE", nil)
style:UIBarButtonItemStyleBordered
target:target
action:selector];
if (SYSTEM_RUNS_IOS7_OR_LATER)
doneButton.tintColor = [UIColor whiteColor];
else {
[doneButton setBackgroundImage:[UIImage imageNamed:@"doneButton"]
forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
[doneButton setBackgroundImage:[UIImage imageNamed:@"doneButtonHighlight"]
forState:UIControlStateHighlighted
barMetrics:UIBarMetricsDefault];
[doneButton setTitleTextAttributes:@{UITextAttributeTextShadowColor : [UIColor whiteColor], UITextAttributeTextColor : [UIColor blackColor]}
forState:UIControlStateNormal];
}
return doneButton;
}
@implementation UIBarButtonItem (ThemedButtons)
+ (UIBarButtonItem *)themedBackButtonWithTarget:(id)target andSelector:(SEL)selector
{
......@@ -98,4 +75,4 @@
return button;
}
@end
@end
\ No newline at end of file
......@@ -26,6 +26,7 @@
#import "VLCConstants.h"
#import "UIColor+Presets.h"
#import "UIBarButtonItem+Theme.h"
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
......
......@@ -14,7 +14,6 @@
#import "VLCAboutViewController.h"
#import "VLCAppDelegate.h"
#import "UIBarButtonItem+Theme.h"
@interface VLCAboutViewController ()
{
......
......@@ -10,7 +10,6 @@
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import "UIBarButtonItem+Theme.h"
#import "VLCCloudServicesTableViewController.h"
#import "VLCAppDelegate.h"
#import "VLCDropboxTableViewController.h"
......
......@@ -13,7 +13,6 @@
*****************************************************************************/
#import "VLCCloudStorageTableViewController.h"
#import "UIBarButtonItem+Theme.h"
#import "VLCProgressView.h"
@interface VLCCloudStorageTableViewController() <VLCCloudStorageDelegate>
......
......@@ -2,13 +2,12 @@
* VLCDownloadViewController.m
* VLC for iOS
*****************************************************************************
* Copyright (c) 2013 VideoLAN. All rights reserved.
* Copyright (c) 2013-2015 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne # videolan.org>
* Gleb Pinigin <gpinigin # gmail.com>
* Pierre Sagaspe <pierre.sagaspe # me.com>
* Romain Goyet <romain.goyet # applidium.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
......@@ -16,7 +15,6 @@
#import "VLCDownloadViewController.h"
#import "VLCHTTPFileDownloader.h"
#import "VLCAppDelegate.h"
#import "UIBarButtonItem+Theme.h"
#import "WhiteRaccoon.h"
#import "NSString+SupportedMedia.h"
#import "VLCHTTPFileDownloader.h"
......
......@@ -17,7 +17,6 @@
#import "VLCFirstStepsFourthPageViewController.h"
#import "VLCFirstStepsFifthPageViewController.h"
#import "VLCFirstStepsSixthPageViewController.h"
#import "UIBarButtonItem+Theme.h"
@interface VLCFirstStepsViewController () <UIPageViewControllerDataSource, UIPageViewControllerDelegate>
{
......@@ -40,7 +39,7 @@
[pageVC setViewControllers:@[[[VLCFirstStepsFirstPageViewController alloc] initWithNibName:nil bundle:nil]] direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:nil];
UIBarButtonItem *dismissButton = [UIBarButtonItem themedDoneButtonWithTarget:self andSelector:@selector(dismissFirstSteps)];
UIBarButtonItem *dismissButton = [UIBarButtonItem themedDarkToolbarButtonWithTitle:NSLocalizedString(@"BUTTON_DONE", nil) target:self andSelector:@selector(dismissFirstSteps)];
self.navigationItem.rightBarButtonItem = dismissButton;
self.title = NSLocalizedString(@"FIRST_STEPS_WELCOME", nil);
self.view.backgroundColor = [UIColor blackColor];
......
......@@ -20,7 +20,6 @@
#import "NSString+SupportedMedia.h"
#import "VLCStatusLabel.h"
#import "VLCAlertView.h"
#import "UIBarButtonItem+Theme.h"
#import "UIDevice+VLC.h"
@interface VLCLocalPlexFolderListViewController () <UITableViewDataSource, UITableViewDelegate, VLCLocalNetworkListCell, UISearchBarDelegate, UISearchDisplayDelegate>
......
......@@ -24,7 +24,6 @@
#import "NSString+SupportedMedia.h"
#import "VLCStatusLabel.h"
#import "BasicUPnPDevice+VLC.h"
#import "UIBarButtonItem+Theme.h"
#import "UIDevice+VLC.h"
#define kVLCServerTypeUPNP 0
......
......@@ -13,7 +13,6 @@
*****************************************************************************/
#import "VLCLocalServerListViewController.h"
#import "UIBarButtonItem+Theme.h"
#import "VLCAppDelegate.h"
#import "UPnPManager.h"
#import "VLCLocalNetworkListCell.h"
......@@ -414,11 +413,8 @@
navCon.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:navCon animated:YES completion:nil];
if (_loginViewController.navigationItem.leftBarButtonItem == nil) {
UIBarButtonItem *doneButton = [UIBarButtonItem themedDoneButtonWithTarget:_loginViewController andSelector:@selector(dismissWithAnimation:)];
_loginViewController.navigationItem.leftBarButtonItem = doneButton;
}
if (_loginViewController.navigationItem.leftBarButtonItem == nil)
_loginViewController.navigationItem.leftBarButtonItem = [UIBarButtonItem themedDarkToolbarButtonWithTitle:NSLocalizedString(@"BUTTON_DONE", nil) target:_loginViewController andSelector:@selector(dismissWithAnimation:)];
} else
[self.navigationController pushViewController:_loginViewController animated:YES];
......
......@@ -29,7 +29,6 @@
#import "VLCLocalServerListViewController.h"
#import "VLCOpenNetworkStreamViewController.h"
#import "VLCSettingsController.h"
#import "UIBarButtonItem+Theme.h"
#import "VLCAboutViewController.h"
#import "VLCPlaylistViewController.h"
#import "VLCBugreporter.h"
......
......@@ -12,7 +12,6 @@
*****************************************************************************/
#import "VLCNetworkLoginViewController.h"
#import "UIBarButtonItem+Theme.h"
@interface VLCNetworkLoginViewController () <UITableViewDataSource, UITableViewDelegate, UITextFieldDelegate>
{
......
......@@ -12,7 +12,6 @@
#import "VLCOneDriveTableViewController.h"
#import "VLCOneDriveController.h"
#import "UIBarButtonItem+Theme.h"
#import "VLCCloudStorageTableViewCell.h"
#import "VLCAppDelegate.h"
#import "VLCOneDriveController.h"
......
......@@ -15,7 +15,6 @@
#import "VLCOpenNetworkStreamViewController.h"
#import "VLCAppDelegate.h"
#import "VLCPlaylistViewController.h"
#import "UIBarButtonItem+Theme.h"
#import "VLCMenuTableViewController.h"
#import "UIDevice+VLC.h"
......
......@@ -17,11 +17,9 @@
#import "VLCMovieViewController.h"
#import "VLCPlaylistTableViewCell.h"
#import "VLCPlaylistCollectionViewCell.h"
#import "UINavigationController+Theme.h"
#import "NSString+SupportedMedia.h"
#import "VLCBugreporter.h"
#import "VLCAppDelegate.h"
#import "UIBarButtonItem+Theme.h"
#import "VLCFirstStepsViewController.h"
#import "VLCFolderCollectionViewFlowLayout.h"
#import "LXReorderableCollectionViewFlowLayout.h"
......
......@@ -12,7 +12,6 @@
#import "VLCPlexConnectServerViewController.h"
#import "VLCLocalPlexFolderListViewController.h"
#import "UIBarButtonItem+Theme.h"
#define kPlexMediaServerPortDefault @"32400"
......
......@@ -12,7 +12,6 @@
#import "VLCPlexMediaInformationViewController.h"
#import "VLCPlexParser.h"
#import "VLCAppDelegate.h"
#import "UIBarButtonItem+Theme.h"
#import "NSString+SupportedMedia.h"
#import "UIDevice+VLC.h"
......
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