diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2014-05-17 05:50:54 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2014-05-17 05:50:54 -0700 |
commit | 830efb5d6dcd0f8bd917781184b6af343f824ac7 (patch) | |
tree | 9157347266612d058c287d3917ccaf906a52e6f0 /MobileCydia.mm | |
parent | 89bdef78892777df6116a0ef56729834f4b4e0d4 (diff) |
Move most of the textField code to back into init.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r-- | MobileCydia.mm | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index fc48972..b89e999 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -7683,8 +7683,19 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi - (id) initWithDatabase:(Database *)database query:(NSString *)query { if ((self = [super initWithDatabase:database title:UCLocalize("SEARCH")])) { search_ = [[[UISearchBar alloc] init] autorelease]; + [search_ setPlaceholder:UCLocalize("SEARCH_EX")]; [search_ setDelegate:self]; + UITextField *textField; + if ([search_ respondsToSelector:@selector(searchField)]) + textField = [search_ searchField]; + else + textField = MSHookIvar<UITextField *>(search_, "_searchField"); + + [textField setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin]; + [textField setEnablesReturnKeyAutomatically:NO]; + [[self navigationItem] setTitleView:textField]; + if (query != nil) [search_ setText:query]; [self useSearch]; @@ -7698,17 +7709,6 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi searchloaded_ = YES; [search_ setFrame:CGRectMake(0, 0, [[self view] bounds].size.width, 44.0f)]; [search_ layoutSubviews]; - [search_ setPlaceholder:UCLocalize("SEARCH_EX")]; - - UITextField *textField; - if ([search_ respondsToSelector:@selector(searchField)]) - textField = [search_ searchField]; - else - textField = MSHookIvar<UITextField *>(search_, "_searchField"); - - [textField setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin]; - [textField setEnablesReturnKeyAutomatically:NO]; - [[self navigationItem] setTitleView:textField]; } if ([self isSummarized]) |