} return self;
}
-// XXX: factor this out somewhere
-- (UIColor *) groupTableViewBackgroundColor {
- UIDevice *device([UIDevice currentDevice]);
- bool iPad([device respondsToSelector:@selector(userInterfaceIdiom)] && [device userInterfaceIdiom] == UIUserInterfaceIdiomPad);
- return iPad ? [UIColor colorWithRed:0.821 green:0.834 blue:0.860 alpha:1] : [UIColor groupTableViewBackgroundColor];
-}
-
- (void) loadView {
[self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]];
- [[self view] setBackgroundColor:[self groupTableViewBackgroundColor]];
+
+ UITableView *table([[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStyleGrouped] autorelease]);
+ [table setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
+ [[self view] addSubview:table];
indicator_ = [[[CYLoadingIndicator alloc] initWithFrame:[[self view] bounds]] autorelease];
[indicator_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
[self _didFailWithError:error forFrame:frame];
}
-// XXX: factor this out somewhere
-- (UIColor *) groupTableViewBackgroundColor {
- UIDevice *device([UIDevice currentDevice]);
- bool iPad([device respondsToSelector:@selector(userInterfaceIdiom)] && [device userInterfaceIdiom] == UIUserInterfaceIdiomPad);
- return iPad ? [UIColor colorWithRed:0.821 green:0.834 blue:0.860 alpha:1] : [UIColor groupTableViewBackgroundColor];
-}
-
- (void) webView:(WebView *)view didFinishLoadForFrame:(WebFrame *)frame {
[loading_ removeObject:[NSValue valueWithNonretainedObject:frame]];
for (DOMHTMLBodyElement *body in (id) bodies) {
DOMCSSStyleDeclaration *style([document getComputedStyle:body pseudoElement:nil]);
- UIColor *uic([self groupTableViewBackgroundColor]);
+ UIColor *uic(nil);
if (DOMCSSPrimitiveValue *color = static_cast<DOMCSSPrimitiveValue *>([style getPropertyCSSValue:@"background-color"])) {
if ([color primitiveType] == DOM_CSS_RGBCOLOR) {
}
}
- [scroller_ setBackgroundColor:uic];
+ [scroller_ setBackgroundColor:(uic ?: [UIColor clearColor])];
break;
}
}
indirect_ = [[IndirectDelegate alloc] initWithDelegate:self];
- webview_ = [[[CYWebView alloc] initWithFrame:[[self view] bounds]] autorelease];
+ CGRect bounds([[self view] bounds]);
+
+ webview_ = [[[CYWebView alloc] initWithFrame:bounds] autorelease];
[webview_ setDelegate:self];
[self setView:webview_];
}
[scroller_ setFixedBackgroundPattern:YES];
- [scroller_ setBackgroundColor:[self groupTableViewBackgroundColor]];
+ [scroller_ setBackgroundColor:[UIColor clearColor]];
[scroller_ setClipsSubviews:YES];
[scroller_ setBounces:YES];
indicator_ = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
[indicator_ setFrame:CGRectMake(15, 5, [indicator_ frame].size.width, [indicator_ frame].size.height)];
+ UITableView *table([[[UITableView alloc] initWithFrame:bounds style:UITableViewStyleGrouped] autorelease]);
+ [webview_ insertSubview:table atIndex:0];
+
+ [table setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
[webview_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
[indicator_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin];
} return self;