Skip to content

Commit

Permalink
Use cell tint color if available
Browse files Browse the repository at this point in the history
  • Loading branch information
escoz committed Oct 4, 2013
1 parent 78f2276 commit 5a39d1c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions quickdialog/QBadgeElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ @implementation QBadgeElement {

- (QBadgeElement *)init {
self = [super init];
_badgeColor = [UIColor colorWithRed:0.530f green:0.600f blue:0.738f alpha:1.000f];
_badgeColor = nil;
_badgeTextColor = [UIColor whiteColor];
return self;
}
Expand All @@ -43,8 +43,13 @@ - (UITableViewCell *)getCellForTableView:(QuickDialogTableView *)tableView contr
QBadgeTableCell *cell = [[QBadgeTableCell alloc] init];
cell.textLabel.text = _title;
[cell applyAppearanceForElement:self];
cell.badgeLabel.badgeColor = _badgeColor;
cell.badgeLabel.textColor = _badgeTextColor;

if ([cell respondsToSelector:@selector(tintColor)])
cell.badgeLabel.badgeColor = _badgeColor == nil ? cell.tintColor : _badgeTextColor;
else
cell.badgeLabel.badgeColor = _badgeColor;

cell.badgeLabel.text = _badge;
cell.accessoryType = UITableViewCellAccessoryNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
Expand Down

0 comments on commit 5a39d1c

Please sign in to comment.