summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrant Paul <chpwn@chpwn.com>2010-10-16 22:01:35 -0700
committerGrant Paul <chpwn@chpwn.com>2010-10-16 22:01:35 -0700
commite454f9c3d97de1d5253378b7aa3b8a7a677af52a (patch)
treec3397f31fd7983e8e574f6747b23fcc974ff58f7
parent632f629bdb6a20d57f4ff9e98821f1cedd4b9385 (diff)
Refactored out status bar height code, fixed landscape dropped bar.
-rw-r--r--Cydia.mm12
1 files changed, 10 insertions, 2 deletions
diff --git a/Cydia.mm b/Cydia.mm
index 07d44a7..ef602ac 100644
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -7766,13 +7766,21 @@ freeing the view controllers on tab change */
updatedelegate_ = delegate;
}
+- (CGFloat) statusBarHeight {
+ if (UIInterfaceOrientationIsPortrait([self interfaceOrientation])) {
+ return [[UIApplication sharedApplication] statusBarFrame].size.height;
+ } else {
+ return [[UIApplication sharedApplication] statusBarFrame].size.width;
+ }
+}
+
- (void) dropBar:(BOOL)animated {
if (dropped_) return;
dropped_ = true;
[[self view] addSubview:refreshbar_];
- CGFloat sboffset = [[UIApplication sharedApplication] statusBarFrame].size.height;
+ CGFloat sboffset = [self statusBarHeight];
CGRect barframe = [refreshbar_ frame];
barframe.origin.y = sboffset;
@@ -7799,7 +7807,7 @@ freeing the view controllers on tab change */
[refreshbar_ removeFromSuperview];
- CGFloat sboffset = [[UIApplication sharedApplication] statusBarFrame].size.height;
+ CGFloat sboffset = [self statusBarHeight];
if (animated) [UIView beginAnimations:nil context:NULL];
CGRect barframe = [refreshbar_ frame];