]> git.saurik.com Git - cydia.git/commitdiff
Fix reload button layout on 2.x browser.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 2 Dec 2010 07:00:25 +0000 (23:00 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 2 Dec 2010 08:51:45 +0000 (00:51 -0800)
UICaboodle/BrowserView.mm

index bacc40b2e0a56b6827dddd28a4319d282f3607b1..db8719cb3d8f565fadd2071baaaa22ae0605b9e4 100644 (file)
@@ -881,11 +881,15 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
     [[self navigationItem] setTitle:UCLocalize("LOADING")];
 }
 
+- (void) layoutRightButton {
+    [[loadingitem_ view] addSubview:indicator_];
+    [[loadingitem_ view] bringSubviewToFront:indicator_];
+}
+
 - (void) applyRightButton {
     if ([self isLoading]) {
         [[self navigationItem] setRightBarButtonItem:loadingitem_ animated:YES];
-        // XXX: why do we do this again here? (if we don't, just remove indicator_)
-        [[loadingitem_ view] addSubview:indicator_];
+        [self performSelector:@selector(layoutRightButton) withObject:nil afterDelay:0];
         [self applyLoadingTitle];
     } else if (custom_ != nil) {
         [[self navigationItem] setRightBarButtonItem:[self customButton] animated:YES];
@@ -1006,7 +1010,6 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
         indicator_ = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; 
         [indicator_ setFrame:CGRectMake(15, 5, [indicator_ frame].size.width, [indicator_ frame].size.height)];
         [indicator_ startAnimating];
-        [[loadingitem_ view] addSubview:indicator_];
 
         [webview_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
         [indicator_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin];