]> git.saurik.com Git - cydia.git/commitdiff
Refactored out status bar height code, fixed landscape dropped bar.
authorGrant Paul <chpwn@chpwn.com>
Sun, 17 Oct 2010 05:01:35 +0000 (22:01 -0700)
committerGrant Paul <chpwn@chpwn.com>
Sun, 17 Oct 2010 05:01:35 +0000 (22:01 -0700)
Cydia.mm

index 07d44a75a9e9a53e7cb201f465839fdcff2b8264..ef602ac8252366d85ec14a07ba8fe9e24af0f54f 100644 (file)
--- 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];