From: Jay Freeman (saurik) Date: Thu, 24 Feb 2011 02:13:55 +0000 (-0800) Subject: Added cydia.setNavigationBarStyle(). X-Git-Tag: v1.1.0%b1~226 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/824062172d3effbead0e24eaae0ba60f7eb86969 Added cydia.setNavigationBarStyle(). --- diff --git a/MobileCydia.mm b/MobileCydia.mm index d99a0e86..9364e3a4 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4116,6 +4116,8 @@ static NSString *Warning_; return @"setButtonTitle"; else if (selector == @selector(setHidesBackButton:)) return @"setHidesBackButton"; + else if (selector == @selector(setNavigationBarStyle:)) + return @"setNavigationBarStyle"; else if (selector == @selector(setPopupHook:)) return @"setPopupHook"; else if (selector == @selector(setToken:)) @@ -4284,6 +4286,10 @@ static NSString *Warning_; [indirect_ performSelectorOnMainThread:@selector(setHidesBackButtonByNumber:) withObject:value waitUntilDone:NO]; } +- (void) setNavigationBarStyle:(NSString *)value { + [indirect_ performSelectorOnMainThread:@selector(setNavigationBarStyle:) withObject:value waitUntilDone:NO]; +} + - (void) _setToken:(NSString *)token { Token_ = token; diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm index 2a05005a..b4ca1a12 100644 --- a/UICaboodle/BrowserView.mm +++ b/UICaboodle/BrowserView.mm @@ -1170,6 +1170,16 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se return 980; } +- (void) setNavigationBarStyle:(NSString *)name { + UIBarStyle style; + if ([name isEqualToString:@"Black"]) + style = UIBarStyleBlack; + else + style = UIBarStyleDefault; + + [[[self navigationController] navigationBar] setBarStyle:style]; +} + - (void) setHidesBackButton:(bool)value { [[self navigationItem] setHidesBackButton:value]; }