summaryrefslogtreecommitdiff
path: root/CyteKit
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-17 02:40:48 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-17 02:40:48 -0700
commit4886cc818ca3f52c7c1683b45ffcdef8b6e57217 (patch)
treece3a88a978d156daf4cd0fbd63e0d9b02de7807c /CyteKit
parentf18b4a9767afe6603948fcb7750a24e386b5f0eb (diff)
Add cydia.setScrollIndicatorStyle().
Diffstat (limited to 'CyteKit')
-rw-r--r--CyteKit/WebViewController.h2
-rw-r--r--CyteKit/WebViewController.mm26
2 files changed, 28 insertions, 0 deletions
diff --git a/CyteKit/WebViewController.h b/CyteKit/WebViewController.h
index 2bd5320..e3d5838 100644
--- a/CyteKit/WebViewController.h
+++ b/CyteKit/WebViewController.h
@@ -146,6 +146,8 @@
- (void) setViewportWidthOnMainThread:(float)value;
+- (void) setScrollIndicatorStyle:(UIScrollViewIndicatorStyle)style;
+
@end
#endif//CyteKit_WebViewController_H
diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm
index d347a39..f4bb58e 100644
--- a/CyteKit/WebViewController.mm
+++ b/CyteKit/WebViewController.mm
@@ -559,6 +559,7 @@ float CYScrollViewDecelerationRateNormal;
allowsNavigationAction_ = true;
[self setHidesNavigationBar:NO];
+ [self setScrollIndicatorStyle:UIScrollViewIndicatorStyleDefault];
// XXX: do we still need to do this?
[[self navigationItem] setTitle:nil];
@@ -995,6 +996,31 @@ float CYScrollViewDecelerationRateNormal;
[self setHidesNavigationBar:[value boolValue]];
}
+- (void) setScrollIndicatorStyle:(UIScrollViewIndicatorStyle)style {
+ if ([webview_ respondsToSelector:@selector(_scrollView)]) {
+ UIScrollView *scroller([webview_ _scrollView]);
+ [scroller setIndicatorStyle:style];
+ } else if ([webview_ respondsToSelector:@selector(_scroller)]) {
+ UIScroller *scroller([webview_ _scroller]);
+ [scroller setScrollerIndicatorStyle:style];
+ } else return;
+}
+
+- (void) setScrollIndicatorStyleWithName:(NSString *)style {
+ UIScrollViewIndicatorStyle value;
+
+ if (false);
+ else if ([style isEqualToString:@"default"])
+ value = UIScrollViewIndicatorStyleDefault;
+ else if ([style isEqualToString:@"black"])
+ value = UIScrollViewIndicatorStyleBlack;
+ else if ([style isEqualToString:@"white"])
+ value = UIScrollViewIndicatorStyleWhite;
+ else return;
+
+ [self setScrollIndicatorStyle:value];
+}
+
- (void) viewWillAppear:(BOOL)animated {
visible_ = true;