]> git.saurik.com Git - cydia.git/commitdiff
Carry bgcolor over to the next WebViewController.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 23 Dec 2013 23:02:25 +0000 (15:02 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 23 Dec 2013 23:02:25 +0000 (15:02 -0800)
CyteKit/WebViewController.h
CyteKit/WebViewController.mm

index cb1bf610bfa5e3374d756f22366225edee3e8e71..c8d9d5123ce829eb325daa90be0a22ee63551a25 100644 (file)
@@ -71,6 +71,7 @@
 
     float width_;
     Class class_;
+    _H<UIColor> color_;
 
     _H<UIBarButtonItem> reloaditem_;
     _H<UIBarButtonItem> loadingitem_;
 - (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;
index f8537100df164167dc24447fb2aacee4d7eca506..f5ec06094f7546edc81ed5a2924239c4b88402ae 100644 (file)
@@ -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;