Commit 813949bc authored by Mark Cogan's avatar Mark Cogan Committed by Commit Bot

[iOS] Match segmented control text color to icon color.

Bug: 849648
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I7544bfb35f53a4e0c7bfbc687d3f5a10d2629cd1
Reviewed-on: https://chromium-review.googlesource.com/1093435Reviewed-by: default avataredchin <edchin@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566009}
parent b7f31936
...@@ -100,6 +100,8 @@ const int kSliderColor = 0xF8F9FA; ...@@ -100,6 +100,8 @@ const int kSliderColor = 0xF8F9FA;
const int kBackgroundColor = 0x5F6368; const int kBackgroundColor = 0x5F6368;
// Alpha for the background view. // Alpha for the background view.
const CGFloat kBackgroundAlpha = 1.0; const CGFloat kBackgroundAlpha = 1.0;
// Color for the regular tab count label
const CGFloat kSelectedLabelColor = 0x3C4043;
// Returns the point that's at the center of |rect|. // Returns the point that's at the center of |rect|.
CGPoint RectCenter(CGRect rect) { CGPoint RectCenter(CGRect rect) {
...@@ -488,7 +490,8 @@ NSString* StringForItemCount(long count) { ...@@ -488,7 +490,8 @@ NSString* StringForItemCount(long count) {
// Selected labels use a different size and are black. // Selected labels use a different size and are black.
- (UILabel*)labelSelected:(BOOL)selected { - (UILabel*)labelSelected:(BOOL)selected {
CGFloat size = selected ? kSelectedLabelSize : kLabelSize; CGFloat size = selected ? kSelectedLabelSize : kLabelSize;
UIColor* color = selected ? UIColor.blackColor : UIColorFromRGB(kSliderColor); UIColor* color = selected ? UIColorFromRGB(kSelectedLabelColor)
: UIColorFromRGB(kSliderColor);
UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, size, size)]; UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, size, size)];
label.backgroundColor = UIColor.clearColor; label.backgroundColor = UIColor.clearColor;
label.textAlignment = NSTextAlignmentCenter; label.textAlignment = NSTextAlignmentCenter;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment