From 5738f070516b40d0ae4e0ebb570ec86449b4ad60 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 23 Dec 2013 15:02:25 -0800 Subject: Carry bgcolor over to the next WebViewController. --- CyteKit/WebViewController.h | 3 +++ CyteKit/WebViewController.mm | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'CyteKit') diff --git a/CyteKit/WebViewController.h b/CyteKit/WebViewController.h index cb1bf61..c8d9d51 100644 --- a/CyteKit/WebViewController.h +++ b/CyteKit/WebViewController.h @@ -71,6 +71,7 @@ float width_; Class class_; + _H color_; _H reloaditem_; _H loadingitem_; @@ -102,6 +103,8 @@ - (id) initWithWidth:(float)width; - (id) initWithWidth:(float)width ofClass:(Class)_class; +- (void) setColor:(UIColor *)color; + - (void) callFunction:(WebScriptObject *)function; - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame; diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index f853710..f5ec060 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -418,6 +418,7 @@ float CYScrollViewDecelerationRateNormal; if (page == nil) { CyteWebViewController *browser([[[class_ alloc] init] autorelease]); + [browser setColor:color_]; [browser setRequest:request]; page = browser; } @@ -587,6 +588,10 @@ float CYScrollViewDecelerationRateNormal; } } + if (uic == nil) + uic = [UIColor groupTableViewBackgroundColor]; + + color_ = uic; [scroller_ setBackgroundColor:uic]; break; } @@ -833,6 +838,8 @@ float CYScrollViewDecelerationRateNormal; width_ = width; class_ = _class; + color_ = [UIColor groupTableViewBackgroundColor]; + allowsNavigationAction_ = true; loading_ = [NSMutableSet setWithCapacity:5]; @@ -950,7 +957,7 @@ float CYScrollViewDecelerationRateNormal; } [scroller_ setFixedBackgroundPattern:YES]; - [scroller_ setBackgroundColor:[UIColor groupTableViewBackgroundColor]]; + [scroller_ setBackgroundColor:color_]; [scroller_ setClipsSubviews:YES]; [scroller_ setBounces:YES]; @@ -993,6 +1000,10 @@ float CYScrollViewDecelerationRateNormal; } return self; } +- (void) setColor:(UIColor *)color { + color_ = color; +} + - (void) callFunction:(WebScriptObject *)function { WebThreadLocked lock; -- cgit v1.2.3