From: Jay Freeman (saurik) Date: Tue, 8 Mar 2011 18:42:36 +0000 (-0800) Subject: Move -[CYTabBarController statusBarHeight] to ::CYStatusBarHeight(). X-Git-Tag: v1.1.0%b2~9 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/57daa971cb88b48e747968e4279b195fc199c4c8 Move -[CYTabBarController statusBarHeight] to ::CYStatusBarHeight(). --- diff --git a/MobileCydia.mm b/MobileCydia.mm index ebe39718..23a94029 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -266,6 +266,11 @@ static _finline void UpdateExternalStatus(uint64_t newStatus) { notify_post("com.saurik.Cydia.status"); } +static CGFloat CYStatusBarHeight(UIInterfaceOrientation orientation) { + CGSize size([[UIApplication sharedApplication] statusBarFrame].size); + return UIInterfaceOrientationIsPortrait(orientation) ? size.height : size.width; +} + /* NSForcedOrderingSearch doesn't work on the iPhone */ static const NSStringCompareOptions MatchCompareOptions_ = NSLiteralSearch | NSCaseInsensitiveSearch; static const NSStringCompareOptions LaxCompareOptions_ = NSNumericSearch | NSDiacriticInsensitiveSearch | NSWidthInsensitiveSearch | NSCaseInsensitiveSearch; @@ -6533,14 +6538,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { updatedelegate_ = delegate; } -- (CGFloat) statusBarHeight { - if (UIInterfaceOrientationIsPortrait([self interfaceOrientation])) { - return [[UIApplication sharedApplication] statusBarFrame].size.height; - } else { - return [[UIApplication sharedApplication] statusBarFrame].size.width; - } -} - - (UIView *) transitionView { if ([self respondsToSelector:@selector(_transitionView)]) return [self _transitionView]; @@ -6559,7 +6556,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { CGRect barframe([refreshbar_ frame]); if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iPhoneOS_3_0) // XXX: _UIApplicationLinkedOnOrAfter(4) - barframe.origin.y = [self statusBarHeight]; + barframe.origin.y = CYStatusBarHeight([self interfaceOrientation]); else barframe.origin.y = 0;