]> git.saurik.com Git - cydia.git/commitdiff
Using only one (!) private API, completely fix the doubled-status-bar and "black...
authorGrant Paul <chpwn@chpwn.com>
Sun, 17 Oct 2010 02:44:53 +0000 (19:44 -0700)
committerGrant Paul <chpwn@chpwn.com>
Sun, 17 Oct 2010 02:44:53 +0000 (19:44 -0700)
Cydia.mm

index 1dfe4313ddaf2cce36e2f08046dc077507108161..07d44a75a9e9a53e7cb201f465839fdcff2b8264 100644 (file)
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -7624,11 +7624,16 @@ freeing the view controllers on tab change */
 - (void) dropBar:(BOOL)animated;
 - (void) beginUpdate;
 - (void) raiseBar:(BOOL)animated;
+- (BOOL) updating;
 
 @end
 
 @implementation CYContainer
 
+- (BOOL) _reallyWantsFullScreenLayout {
+    return YES;
+}
+
 // NOTE: UIWindow only sends the top controller these messages,
 //       So we have to forward them on.
 
@@ -7767,11 +7772,16 @@ freeing the view controllers on tab change */
 
     [[self view] addSubview:refreshbar_];
 
+    CGFloat sboffset = [[UIApplication sharedApplication] statusBarFrame].size.height;
+
+    CGRect barframe = [refreshbar_ frame];   
+    barframe.origin.y = sboffset;
+    [refreshbar_ setFrame:barframe];
+
     if (animated) [UIView beginAnimations:nil context:NULL];
-    CGRect barframe = [refreshbar_ frame];
     CGRect viewframe = [[root_ view] frame];
-    viewframe.origin.y += barframe.size.height;
-    viewframe.size.height -= barframe.size.height;
+    viewframe.origin.y += barframe.size.height + sboffset;
+    viewframe.size.height -= barframe.size.height + sboffset;
     [[root_ view] setFrame:viewframe];
     if (animated) [UIView commitAnimations];
 
@@ -7789,11 +7799,13 @@ freeing the view controllers on tab change */
 
     [refreshbar_ removeFromSuperview];
 
+    CGFloat sboffset = [[UIApplication sharedApplication] statusBarFrame].size.height;
+
     if (animated) [UIView beginAnimations:nil context:NULL];
     CGRect barframe = [refreshbar_ frame];
     CGRect viewframe = [[root_ view] frame];
-    viewframe.origin.y -= barframe.size.height;
-    viewframe.size.height += barframe.size.height;
+    viewframe.origin.y -= barframe.size.height + sboffset;
+    viewframe.size.height += barframe.size.height + sboffset;
     [[root_ view] setFrame:viewframe];
     if (animated) [UIView commitAnimations];
 
@@ -7816,8 +7828,16 @@ freeing the view controllers on tab change */
     [[root_ selectedViewController] _updateLayoutForStatusBarAndInterfaceOrientation];
 }
 
+- (void) statusBarFrameChanged:(NSNotification *)notification {
+    if (dropped_) {
+        [self raiseBar:NO];
+        [self dropBar:NO];
+    }
+}
+
 - (void) dealloc {
     [refreshbar_ release];
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
     [super dealloc];
 }
 
@@ -7826,6 +7846,7 @@ freeing the view controllers on tab change */
         database_ = database;
 
         [[self view] setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarFrameChanged:) name:UIApplicationDidChangeStatusBarFrameNotification object:nil];
 
         refreshbar_ = [[RefreshBar alloc] initWithFrame:CGRectMake(0, 0, [[self view] frame].size.width, [UINavigationBar defaultSize].height) delegate:self];
     } return self;