diff options
author | Paul Gardiner <paul.gardiner@artifex.com> | 2014-04-24 11:14:33 +0100 |
---|---|---|
committer | Paul Gardiner <paul.gardiner@artifex.com> | 2014-04-24 11:14:33 +0100 |
commit | a2e9a46fea0489c341e0dd713763b0fd609b47c2 (patch) | |
tree | 5488d6f4e9cccf98b8bc5f283c67b8e2423db7f7 /platform/ios/Classes | |
parent | 7fbb212ad2dbf247eec66d7f5ffe6672a75a43ec (diff) | |
download | mupdf-a2e9a46fea0489c341e0dd713763b0fd609b47c2.tar.xz |
iOS: remove the annotations button for non-interactive document types
Diffstat (limited to 'platform/ios/Classes')
-rw-r--r-- | platform/ios/Classes/MuDocRef.h | 1 | ||||
-rw-r--r-- | platform/ios/Classes/MuDocRef.m | 1 | ||||
-rw-r--r-- | platform/ios/Classes/MuDocumentController.m | 5 |
3 files changed, 6 insertions, 1 deletions
diff --git a/platform/ios/Classes/MuDocRef.h b/platform/ios/Classes/MuDocRef.h index ed442be2..3741c691 100644 --- a/platform/ios/Classes/MuDocRef.h +++ b/platform/ios/Classes/MuDocRef.h @@ -6,6 +6,7 @@ { @public fz_document *doc; + bool interactive; } -(id) initWithFilename:(char *)aFilename; @end diff --git a/platform/ios/Classes/MuDocRef.m b/platform/ios/Classes/MuDocRef.m index 4c054ab2..fdec0df9 100644 --- a/platform/ios/Classes/MuDocRef.m +++ b/platform/ios/Classes/MuDocRef.m @@ -19,6 +19,7 @@ { pdf_document *idoc = pdf_specifics(doc); if (idoc) pdf_enable_js(idoc); + interactive = (idoc != NULL); } } return self; diff --git a/platform/ios/Classes/MuDocumentController.m b/platform/ios/Classes/MuDocumentController.m index 3e95b505..8e49c27f 100644 --- a/platform/ios/Classes/MuDocumentController.m +++ b/platform/ios/Classes/MuDocumentController.m @@ -459,7 +459,10 @@ static void saveDoc(char *current_path, fz_document *doc) - (void) showMoreMenu { - [[self navigationItem] setRightBarButtonItems:[NSArray arrayWithObjects:annotButton, printButton, shareButton, nil]]; + NSMutableArray *rightbuttons = [NSMutableArray arrayWithObjects:printButton, shareButton, nil]; + if (docRef->interactive) + [rightbuttons insertObject:annotButton atIndex:0]; + [[self navigationItem] setRightBarButtonItems:rightbuttons]; [[self navigationItem] setLeftBarButtonItem:cancelButton]; barmode = BARMODE_MORE; |