Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fixed prefs
No need for respring anymore to change prefs - Also a fancy header cell - Lots of love added too
- Loading branch information
Showing
15 changed files
with
109 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#import <Preferences/PSControlTableCell.h> | ||
#import <Preferences/PSListController.h> | ||
#import <Preferences/PSSpecifier.h> | ||
#import <Preferences/PSSwitchTableCell.h> | ||
#import <Preferences/PSTableCell.h> | ||
#import <Preferences/PSViewController.h> | ||
#import "PreferencesTableCustomView-Protocol.h" | ||
|
||
@interface NSArray(Private) | ||
- (id)specifierForID:(id)id; | ||
@end | ||
|
||
@interface HeaderCell : PSTableCell <PreferencesTableCustomView> | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#import "HeaderCell.h" | ||
|
||
@implementation HeaderCell | ||
- (id)initWithSpecifier:(PSSpecifier *)specifier{ | ||
self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"HeaderCell" specifier:specifier]; | ||
if (self) { | ||
NSBundle *bundle = [NSBundle bundleForClass:self.class]; | ||
UIImage *banner = [UIImage imageNamed:@"FLEX12_git" | ||
inBundle:bundle | ||
compatibleWithTraitCollection:nil]; | ||
float width = [UIScreen mainScreen].bounds.size.width; | ||
UIImageView *backgroundView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 15, width, width / 4.582)]; | ||
|
||
[backgroundView setContentMode: UIViewContentModeScaleAspectFit]; | ||
backgroundView.image = banner; | ||
[self addSubview: backgroundView]; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
#pragma mark - Protocols | ||
|
||
- (CGFloat)preferredHeightForWidth:(CGFloat)width { | ||
// Appears to be zero on the first call for w/e stupid reason. That breaks things? | ||
if (width == 0) { | ||
width = [UIScreen mainScreen].bounds.size.width; | ||
} | ||
// Our background has a ratio of 3.75w : 1h. | ||
return width / 4.582 + 7.5; | ||
} | ||
|
||
- (CGFloat)preferredHeightForWidth:(CGFloat)width inTableView:(id)tableView { | ||
return [self preferredHeightForWidth:width]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@protocol PreferencesTableCustomView | ||
- (id)initWithSpecifier:(id)specifier; | ||
@optional | ||
- (CGFloat)preferredHeightForWidth:(CGFloat)width; | ||
- (CGFloat)preferredHeightForWidth:(CGFloat)width inTableView:(id)tableView; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.