summaryrefslogtreecommitdiff
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
parentf18b4a9767afe6603948fcb7750a24e386b5f0eb (diff)
Add cydia.setScrollIndicatorStyle().
-rw-r--r--CyteKit/WebViewController.h2
-rw-r--r--CyteKit/WebViewController.mm26
-rw-r--r--MobileCydia.mm6
-rw-r--r--iPhonePrivate.h1
4 files changed, 35 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;
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 4b0fb36..a56ca11 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -4113,6 +4113,8 @@ static _H<NSMutableSet> Diversions_;
return @"setPasteboardString";
else if (selector == @selector(setPasteboardURL:))
return @"setPasteboardURL";
+ else if (selector == @selector(setScrollIndicatorStyle:))
+ return @"setScrollIndicatorStyle";
else if (selector == @selector(setToken:))
return @"setToken";
else if (selector == @selector(setViewportWidth:))
@@ -4139,6 +4141,10 @@ static _H<NSMutableSet> Diversions_;
[delegate_ performSelectorOnMainThread:@selector(unloadData) withObject:nil waitUntilDone:NO];
}
+- (void) setScrollIndicatorStyle:(NSString *)style {
+ [indirect_ performSelectorOnMainThread:@selector(setScrollIndicatorStyleWithName:) withObject:style waitUntilDone:NO];
+}
+
- (void) addInternalRedirect:(NSString *)from :(NSString *)to {
[CydiaWebViewController performSelectorOnMainThread:@selector(addDiversion:) withObject:[[[Diversion alloc] initWithFrom:from to:to] autorelease] waitUntilDone:NO];
}
diff --git a/iPhonePrivate.h b/iPhonePrivate.h
index ed8a91f..788c3c5 100644
--- a/iPhonePrivate.h
+++ b/iPhonePrivate.h
@@ -80,6 +80,7 @@ typedef enum {
- (void) setOffset:(CGPoint)offset;
- (void) setScrollDecelerationFactor:(float)factor;
- (void) setScrollHysteresis:(float)hysteresis;
+- (void) setScrollerIndicatorStyle:(UIScrollViewIndicatorStyle)style;
- (void) setThumbDetectionEnabled:(BOOL)enabled;
@end