summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrant Paul <chpwn@chpwn.com>2010-10-03 02:01:31 -0700
committerJay Freeman <saurik@Jay-Freemans-MacBook-Pro.local>2010-10-04 00:12:22 -0700
commite62f29c63dd001913beeb95b2fa39ad703e36e74 (patch)
tree88e944520e6d5258234f605dd1a08dad6a82b750
parent43e1f0b9601792175e2dbad92906a3f0fddec55f (diff)
Improved positioning and rotation support of Settings view.
-rw-r--r--Cydia.mm23
1 files changed, 18 insertions, 5 deletions
diff --git a/Cydia.mm b/Cydia.mm
index f8668cb..eb17d6a 100644
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -7529,6 +7529,7 @@ freeing the view controllers on tab change */
}
[segment_ addTarget:self action:@selector(segmentChanged:) forControlEvents:UIControlEventValueChanged];
+ [self resizeSegmentedControl];
table_ = [[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStyleGrouped];
[table_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
@@ -7539,11 +7540,23 @@ freeing the view controllers on tab change */
} return self;
}
+- (void) resizeSegmentedControl {
+ CGFloat width = [[self view] frame].size.width;
+ [segment_ setFrame:CGRectMake(width / 32.0f, 0, width - (width / 32.0f * 2.0f), 44.0f)];
+}
+
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
- CGFloat width = [[self view] frame].size.width;
- [segment_ setFrame:CGRectMake(width / 32.0f, 0, width - (width / 32.0f * 2.0f), 44.0f)];
+ [self resizeSegmentedControl];
+}
+
+- (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration {
+ [self resizeSegmentedControl];
+}
+
+- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
+ [self resizeSegmentedControl];
}
- (void) save {
@@ -7593,7 +7606,8 @@ freeing the view controllers on tab change */
}
- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
- return 5;
+ // XXX: For not having a single cell in the table, this sure is a lot of sections.
+ return 6;
}
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
@@ -7817,8 +7831,7 @@ freeing the view controllers on tab change */
[[root_ selectedViewController] _updateLayoutForStatusBarAndInterfaceOrientation];
}
-- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
-{
+- (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration {
// XXX: fix Apple's layout bug
[[root_ selectedViewController] _updateLayoutForStatusBarAndInterfaceOrientation];
}