X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/f6047e7dc658702c729e38043dd7556fbcb68940..7ccc1484ab74ebf5797820bdd24edccfd42aaa50:/CyteKit/ViewController.mm diff --git a/CyteKit/ViewController.mm b/CyteKit/ViewController.mm index a573150d..28c7c438 100644 --- a/CyteKit/ViewController.mm +++ b/CyteKit/ViewController.mm @@ -1,5 +1,5 @@ /* Cydia - iPhone UIKit Front-End for Debian APT - * Copyright (C) 2008-2013 Jay Freeman (saurik) + * Copyright (C) 2008-2015 Jay Freeman (saurik) */ /* GNU General Public License, Version 3 {{{ */ @@ -19,14 +19,15 @@ **/ /* }}} */ -#include "CyteKit/ViewController.h" +#include "CyteKit/UCPlatform.h" #include #include -#include "iPhonePrivate.h" +#include "CyteKit/ViewController.h" -extern bool IsWildcat_; +#include "iPhonePrivate.h" +#include @implementation UIViewController (Cydia) @@ -51,9 +52,17 @@ extern bool IsWildcat_; return nil; } +- (NSURL *) navigationURL { + return nil; +} + @end -@implementation CyteViewController +@implementation CyteViewController { + _transient id delegate_; + BOOL loaded_; + _H color_; +} - (void) setDelegate:(id)delegate { delegate_ = delegate; @@ -104,33 +113,16 @@ extern bool IsWildcat_; [super unloadData]; } -- (NSURL *) navigationURL { - return nil; -} - -- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation { - return IsWildcat_ || orientation == UIInterfaceOrientationPortrait; -} - -- (NSUInteger) supportedInterfaceOrientations { - return IsWildcat_ ? UIInterfaceOrientationMaskAll : UIInterfaceOrientationMaskPortrait; +- (void) setPageColor:(UIColor *)color { + if (color == nil) + color = [UIColor groupTableViewBackgroundColor]; + color_ = color; } -- (BOOL) shouldAutorotate { - return YES; +- (UIColor *) pageColor { + return color_; } -- (void) setPageColor:(UIColor *)color { - if (color == nil) { - color = [UIColor groupTableViewBackgroundColor]; - // on iOS 6 they removed groupTableViewBackgroundColor (it is present on iOS 5 and iOS 6) - if ([color isEqual:[UIColor clearColor]]) { - if (!IsWildcat_) // on devices that aren't iPads, we can just fall back to pinStripeColor - color = [UIColor pinStripeColor]; - else // I don't remember where I got this color, but it is only an approximation of a gradient - color = [UIColor colorWithRed:(215.0/255.0) green:(217.0/255.0) blue:(223.0/255.0) alpha:1.0]; - } - } color_ = color; -} +#include "InterfaceOrientation.h" @end