Skip to content

Commit

Permalink
Improve use of tint color
Browse files Browse the repository at this point in the history
Use tintColor for editable content such as the value in `PSMultiValueSpecifier` or `PSChildPaneSpecifier`.
Exception: MultiValue elements in list groups are not tinted to emphasize the "Add" button.
  • Loading branch information
futuretap committed Oct 18, 2024
1 parent a6551fd commit 700d7f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion InAppSettingsKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'InAppSettingsKit'
s.version = '3.8'
s.version = '3.8.1'
s.summary = 'This iPhone framework allows settings to be in-app in addition to being in the Settings app.'

s.description = <<-DESC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}

UITableViewCell* cell = [self tableView:tableView newCellForSpecifier:specifier];
cell.textLabel.textColor = (specifier.isAddSpecifier || specifier.textAlignment == NSTextAlignmentCenter) ? self.tintColor : [UILabel appearanceWhenContainedInInstancesOfClasses:@[UITableViewCell.class]].textColor;
if (![specifier.type isEqualToString:kIASKPSSliderSpecifier]) {
cell.imageView.image = specifier.cellImage;
}
Expand Down Expand Up @@ -648,11 +649,16 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

BOOL hasTitle = title.length > 0 && !specifier.isItemSpecifier;
cell.detailTextLabel.text = [[specifier titleForCurrentValue:currentValue ?: specifier.defaultValue] description];
cell.detailTextLabel.textColor = self.tintColor;
if (hasTitle) {
cell.textLabel.text = title;
} else {
cell.textLabel.text = cell.detailTextLabel.text;
cell.detailTextLabel.text = nil;

if (!specifier.parentSpecifier) {
cell.textLabel.textColor = self.tintColor;
}
}
}
else if (specifier.embeddedDatePicker) {
Expand Down Expand Up @@ -760,6 +766,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.textLabel.text = [self.settingsReader titleForId:valueString];
} else {
cell.detailTextLabel.text = [self.settingsReader titleForId:valueString];
cell.detailTextLabel.textColor = self.tintColor;
}
}
}
Expand Down Expand Up @@ -802,7 +809,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.detailTextLabel.textAlignment = specifier.textAlignment;
cell.textLabel.adjustsFontSizeToFitWidth = specifier.adjustsFontSizeToFitWidth;
cell.detailTextLabel.adjustsFontSizeToFitWidth = specifier.adjustsFontSizeToFitWidth;
cell.textLabel.textColor = (specifier.isAddSpecifier || specifier.textAlignment == NSTextAlignmentCenter) ? self.tintColor : [UILabel appearanceWhenContainedInInstancesOfClasses:@[UITableViewCell.class]].textColor;
return cell;
}

Expand Down

0 comments on commit 700d7f2

Please sign in to comment.