diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-11-22 19:50:06 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-11-24 18:10:41 +0100 |
commit | 085c8a05ad38d2b2ca00038ca4d4239786bc7bd0 (patch) | |
tree | ec1f0093b0f9790a1b71a9f4e2c13d5cbe362aff | |
parent | 0ab03af67d5e35ab305e5915e38e71e2c7f6306a (diff) | |
download | mupdf-085c8a05ad38d2b2ca00038ca4d4239786bc7bd0.tar.xz |
Resize searchBar manually instead of relying on automatic resizing.
-rw-r--r-- | ios/main.m | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -13,6 +13,7 @@ #define GAP 20 #define INDICATOR_Y -44-24 #define SLIDER_W (width - GAP - 24) +#define SEARCH_W (width - GAP - 170) static dispatch_queue_t queue; static fz_glyph_cache *glyphcache = NULL; @@ -949,12 +950,9 @@ static UIImage *renderTile(struct document *doc, int number, CGSize screenSize, initWithBarButtonSystemItem: UIBarButtonSystemItemFastForward target:self action:@selector(onSearchNext:)]; - float w = [[UIScreen mainScreen] bounds].size.width - 180; - - searchBar = [[UISearchBar alloc] initWithFrame: CGRectMake(0,0,w,32)]; + searchBar = [[UISearchBar alloc] initWithFrame: CGRectMake(0,0,50,32)]; [searchBar setPlaceholder: @"Search"]; [searchBar setDelegate: self]; - [searchBar setAutoresizingMask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; // HACK to make transparent background [[searchBar.subviews objectAtIndex:0] removeFromSuperview]; @@ -1013,6 +1011,7 @@ static UIImage *renderTile(struct document *doc, int number, CGSize screenSize, [canvas setContentOffset: CGPointMake(current * width, 0)]; [sliderWrapper setWidth: SLIDER_W]; + [searchBar setFrame: CGRectMake(0,0,SEARCH_W,32)]; [[self navigationController] setToolbarHidden: NO animated: animated]; } @@ -1354,6 +1353,7 @@ static UIImage *renderTile(struct document *doc, int number, CGSize screenSize, height = size.height; [sliderWrapper setWidth: SLIDER_W]; + [searchBar setFrame: CGRectMake(0,0,SEARCH_W,32)]; [[[self navigationController] toolbar] setNeedsLayout]; // force layout! |