summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-17 02:50:05 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-17 02:50:05 -0700
commitdb698f4255693ec8276ec4bb16c48ad69b64e458 (patch)
treed1bf5ff9fe681847d807dd5df791846f5a5360aa
parent4886cc818ca3f52c7c1683b45ffcdef8b6e57217 (diff)
Add cydia.setScrollAlwaysBounceVertical().
-rw-r--r--CyteKit/WebViewController.h1
-rw-r--r--CyteKit/WebViewController.mm15
-rw-r--r--MobileCydia.mm6
3 files changed, 22 insertions, 0 deletions
diff --git a/CyteKit/WebViewController.h b/CyteKit/WebViewController.h
index e3d5838..8798803 100644
--- a/CyteKit/WebViewController.h
+++ b/CyteKit/WebViewController.h
@@ -146,6 +146,7 @@
- (void) setViewportWidthOnMainThread:(float)value;
+- (void) setScrollAlwaysBounceVertical:(bool)value;
- (void) setScrollIndicatorStyle:(UIScrollViewIndicatorStyle)style;
@end
diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm
index f4bb58e..7cb5979 100644
--- a/CyteKit/WebViewController.mm
+++ b/CyteKit/WebViewController.mm
@@ -559,6 +559,7 @@ float CYScrollViewDecelerationRateNormal;
allowsNavigationAction_ = true;
[self setHidesNavigationBar:NO];
+ [self setScrollAlwaysBounceVertical:true];
[self setScrollIndicatorStyle:UIScrollViewIndicatorStyleDefault];
// XXX: do we still need to do this?
@@ -996,6 +997,20 @@ float CYScrollViewDecelerationRateNormal;
[self setHidesNavigationBar:[value boolValue]];
}
+- (void) setScrollAlwaysBounceVertical:(bool)value {
+ if ([webview_ respondsToSelector:@selector(_scrollView)]) {
+ UIScrollView *scroller([webview_ _scrollView]);
+ [scroller setAlwaysBounceVertical:value];
+ } else if ([webview_ respondsToSelector:@selector(_scroller)]) {
+ //UIScroller *scroller([webview_ _scroller]);
+ // XXX: I am sad here.
+ } else return;
+}
+
+- (void) setScrollAlwaysBounceVerticalNumber:(NSNumber *)value {
+ [self setScrollAlwaysBounceVertical:[value boolValue]];
+}
+
- (void) setScrollIndicatorStyle:(UIScrollViewIndicatorStyle)style {
if ([webview_ respondsToSelector:@selector(_scrollView)]) {
UIScrollView *scroller([webview_ _scrollView]);
diff --git a/MobileCydia.mm b/MobileCydia.mm
index a56ca11..d02aa5e 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(setScrollAlwaysBounceVertical:))
+ return @"setScrollAlwaysBounceVertical";
else if (selector == @selector(setScrollIndicatorStyle:))
return @"setScrollIndicatorStyle";
else if (selector == @selector(setToken:))
@@ -4141,6 +4143,10 @@ static _H<NSMutableSet> Diversions_;
[delegate_ performSelectorOnMainThread:@selector(unloadData) withObject:nil waitUntilDone:NO];
}
+- (void) setScrollAlwaysBounceVertical:(NSNumber *)value {
+ [indirect_ performSelectorOnMainThread:@selector(setScrollAlwaysBounceVerticalNumber:) withObject:value waitUntilDone:NO];
+}
+
- (void) setScrollIndicatorStyle:(NSString *)style {
[indirect_ performSelectorOnMainThread:@selector(setScrollIndicatorStyleWithName:) withObject:style waitUntilDone:NO];
}