summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2013-12-23 15:02:25 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2013-12-23 15:02:25 -0800
commit5738f070516b40d0ae4e0ebb570ec86449b4ad60 (patch)
treecd33940259464da363116ce3d5f7460f0656775b
parent024cdbbf598b87c39598cbe17e9a0c04a0e09974 (diff)
Carry bgcolor over to the next WebViewController.
-rw-r--r--CyteKit/WebViewController.h3
-rw-r--r--CyteKit/WebViewController.mm13
2 files changed, 15 insertions, 1 deletions
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<UIColor> color_;
_H<UIBarButtonItem> reloaditem_;
_H<UIBarButtonItem> 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;