[ios] Put "Close" or "Maps" buttons on the left in Search and in Downloader

This commit is contained in:
Alex Zolotarev 2012-03-13 15:37:17 +03:00 committed by Alex Zolotarev
parent 831f7f158c
commit 2553e04644
2 changed files with 8 additions and 8 deletions

View file

@ -171,7 +171,7 @@ static void OnSearchResultCallback(search::Results const & res, int queryId)
UINavigationItem * item = [[[UINavigationItem alloc] init] autorelease];
UIBarButtonItem * closeButton = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Maps", @"Search Results - Close search button") style: UIBarButtonItemStyleDone
target:self action:@selector(onCloseButton:)] autorelease];
item.rightBarButtonItem = closeButton;
item.leftBarButtonItem = closeButton;
m_searchBar = [[UISearchBar alloc] init];
m_searchBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

View file

@ -81,16 +81,16 @@ static bool IsOurIndex(TIndex const & theirs, TIndex const & ours)
if ((self = [super initWithNibName:nil bundle:nil]))
{
self.navigationItem.title = header;
// Show About button only on the first page
// Show Close button only on the first page
if ([header compare:NSLocalizedString(@"Download", @"Settings/Downloader - Main downloader window title")] == NSOrderedSame)
{
UIBarButtonItem * aboutButton = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"About", @"Settings/Downloader - About the program button") style: UIBarButtonItemStylePlain
target:self action:@selector(onAboutButton:)] autorelease];
self.navigationItem.leftBarButtonItem = aboutButton;
UIBarButtonItem * closeButton = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Maps", @"Settings/Downloader - Close downloader button") style: UIBarButtonItemStyleDone
target:self action:@selector(onCloseButton:)] autorelease];
self.navigationItem.leftBarButtonItem = closeButton;
}
UIBarButtonItem * closeButton = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Maps", @"Settings/Downloader - Close downloader button") style: UIBarButtonItemStyleDone
target:self action:@selector(onCloseButton:)] autorelease];
self.navigationItem.rightBarButtonItem = closeButton;
UIBarButtonItem * aboutButton = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"About", @"Settings/Downloader - About the program button") style: UIBarButtonItemStylePlain
target:self action:@selector(onAboutButton:)] autorelease];
self.navigationItem.rightBarButtonItem = aboutButton;
}
return self;
}