Skip to content

Commit

Permalink
Update RootOptionsController.m
Browse files Browse the repository at this point in the history
  • Loading branch information
arichornlover authored Nov 28, 2024
1 parent 80e6598 commit 13eaf8f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Sources/RootOptionsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@ - (void)viewDidLoad {
[self setupTableView];
}

- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
self.tableView.frame = self.view.bounds;
}

- (void)setupBackButton {
self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
NSBundle *backIcon = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"uYouPlus" ofType:@"bundle"]];
UIImage *backImage = [UIImage imageNamed:@"Back.png" inBundle:backIcon compatibleWithTraitCollection:nil];
backImage = [self resizeImage:backImage newSize:CGSizeMake(24, 24)];
backImage = [backImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[self.backButton setTintColor:[UIColor whiteColor]];
[self.backButton setTintColor:[UIColor systemBlueColor]];
[self.backButton setImage:backImage forState:UIControlStateNormal];
[self.backButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
[self.backButton setFrame:CGRectMake(0, 0, 24, 24)];
Expand Down Expand Up @@ -80,18 +85,23 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath {
cell.textLabel.adjustsFontSizeToFitWidth = YES;
cell.textLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
cell.detailTextLabel.adjustsFontSizeToFitWidth = YES;
cell.detailTextLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];

BOOL isPortrait = UIDevice.currentDevice.orientation == UIDeviceOrientationPortrait;
BOOL isPhone = UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPhone;

if (indexPath.section == 0) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
if (indexPath.row == 0) {
cell.textLabel.text = @"Custom Theme Color";
cell.detailTextLabel.text = @"You must go to uYouEnhanced settings and then go to 'Dark Mode' and set it to 'Custom Dark Mode' for it to work.";
cell.detailTextLabel.text = isPortrait && isPhone ? @"" : @"You must go to uYouEnhanced settings and then go to 'Dark Mode' and set it to 'Custom Dark Mode' for it to work.";
cell.imageView.image = [UIImage systemImageNamed:@"slider.horizontal.3"];
}
if (indexPath.row == 1) {
cell.textLabel.text = @"Custom Tint Color";
cell.detailTextLabel.text = @"You must go to uYouEnhanced settings and have LowContrastMode enabled and then go to 'LowContrastMode Selector' and set it to 'Custom' for it to work.";
cell.detailTextLabel.text = isPortrait && isPhone ? @"" : @"You must go to uYouEnhanced settings and have LowContrastMode enabled and then go to 'LowContrastMode Selector' and set it to 'Custom' for it to work.";
cell.imageView.image = [UIImage systemImageNamed:@"drop.fill"];
}
} else if (indexPath.section == 1) {
Expand Down

0 comments on commit 13eaf8f

Please sign in to comment.