diff options
author | Paul Gardiner <paul.gardiner@artifex.com> | 2013-11-07 13:57:30 +0000 |
---|---|---|
committer | Paul Gardiner <paul.gardiner@artifex.com> | 2013-11-07 13:58:32 +0000 |
commit | c0c9d9800e3c015a1f401df465fb907eb23fa18c (patch) | |
tree | e9f4583a384947a58aa0b35d0f53391616524f63 /platform/ios/Classes | |
parent | 2880476b2ee10fd8b6e258da5f5c2b7a93746a07 (diff) | |
download | mupdf-c0c9d9800e3c015a1f401df465fb907eb23fa18c.tar.xz |
iOS: fix non-appearance of buttons for files with no outline
Diffstat (limited to 'platform/ios/Classes')
-rw-r--r-- | platform/ios/Classes/MuDocumentController.m | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/platform/ios/Classes/MuDocumentController.m b/platform/ios/Classes/MuDocumentController.m index 01583ac3..675e9b68 100644 --- a/platform/ios/Classes/MuDocumentController.m +++ b/platform/ios/Classes/MuDocumentController.m @@ -78,6 +78,17 @@ static void flattenOutline(NSMutableArray *titles, NSMutableArray *pages, fz_out return [[UIBarButtonItem alloc] initWithImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:resource ofType:@"png"]] style:UIBarButtonItemStylePlain target:self action:selector]; } +- (void) addMainMenuButtons +{ + NSMutableArray *array = [NSMutableArray arrayWithCapacity:3]; + [array addObject:searchButton]; + if (outlineButton) + [array addObject:outlineButton]; + [array addObject:reflowButton]; + [array addObject:linkButton]; + [[self navigationItem] setRightBarButtonItems: array ]; +} + - (void) loadView { [[NSUserDefaults standardUserDefaults] setObject: key forKey: @"OpenDocumentKey"]; @@ -153,8 +164,7 @@ static void flattenOutline(NSMutableArray *titles, NSMutableArray *pages, fz_out [prevButton setEnabled: NO]; [nextButton setEnabled: NO]; - [[self navigationItem] setRightBarButtonItems: - [NSArray arrayWithObjects: searchButton, outlineButton, reflowButton, linkButton, nil]]; + [self addMainMenuButtons]; // TODO: add activityindicator to search bar @@ -319,8 +329,7 @@ static void flattenOutline(NSMutableArray *titles, NSMutableArray *pages, fz_out cancelSearch = YES; [searchBar resignFirstResponder]; [[self navigationItem] setTitleView: nil]; - [[self navigationItem] setRightBarButtonItems: - [NSArray arrayWithObjects: searchButton, linkButton, outlineButton, nil]]; + [self addMainMenuButtons]; [[self navigationItem] setLeftBarButtonItem: nil]; [self resetSearch]; } |