]> git.saurik.com Git - cydia.git/commitdiff
Export cydia.setNavigationBarTintColor() to JS.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 24 Feb 2011 14:32:05 +0000 (06:32 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 7 Mar 2011 10:41:14 +0000 (02:41 -0800)
MobileCydia.mm
UICaboodle/BrowserView.mm

index 2fbdaada8e3a5f10a0fbe27fe2908d0a63ada19a..5b4dc06c9aee6f47128f657e0adb85fafcf6e1cb 100644 (file)
@@ -4125,6 +4125,8 @@ static NSString *Warning_;
         return @"setHidesNavigationBar";
     else if (selector == @selector(setNavigationBarStyle:))
         return @"setNavigationBarStyle";
+    else if (selector == @selector(setNavigationBarTintRed:green:blue:alpha:))
+        return @"setNavigationBarTintColor";
     else if (selector == @selector(setPopupHook:))
         return @"setPopupHook";
     else if (selector == @selector(setToken:))
@@ -4301,6 +4303,12 @@ static NSString *Warning_;
     [indirect_ performSelectorOnMainThread:@selector(setNavigationBarStyle:) withObject:value waitUntilDone:NO];
 }
 
+- (void) setNavigationBarTintRed:(NSNumber *)red green:(NSNumber *)green blue:(NSNumber *)blue alpha:(NSNumber *)alpha {
+    float opacity(alpha == (id) [WebUndefined undefined] ? 1 : [alpha floatValue]);
+    UIColor *color([UIColor colorWithRed:[red floatValue] green:[green floatValue] blue:[blue floatValue] alpha:opacity]);
+    [indirect_ performSelectorOnMainThread:@selector(setNavigationBarTintColor:) withObject:color waitUntilDone:NO];
+}
+
 - (void) _setToken:(NSString *)token {
     Token_ = token;
 
index b145048e99f6beedb14ccba06f63638cf1aace28..9b0eda336cf5be3b1b3c4fdf2ae78fb2eca85df6 100644 (file)
@@ -1181,6 +1181,10 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
     [[[self navigationController] navigationBar] setBarStyle:style];
 }
 
+- (void) setNavigationBarTintColor:(UIColor *)color {
+    [[[self navigationController] navigationBar] setTintColor:color];
+}
+
 - (void) setHidesBackButton:(bool)value {
     [[self navigationItem] setHidesBackButton:value];
 }