Commit 7551b94a authored by Robbie Gibson's avatar Robbie Gibson Committed by Commit Bot

[iOS][Dark Mode] Cleanup leftover settings colors

Most of the changes are a straightforward replace:
kTableViewTextLabelColorBlue -> blue_color
kTableViewTextLabelColorLightGrey -> cr_labelColor
kTableViewSecondaryLabelLightGrayTextColor -> cr_secondaryLabelColor

This also sets the tint color for the language settings vc so the
accessory checkmarks appear correctly.

Bug: 976668
Change-Id: Ifb8b1f8fd7437d6910c60ed232bbbb8ae63f2c1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1774443
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691529}
parent 2c23b14c
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/UIColor+cr_semantic_colors.h" #import "ios/chrome/common/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#import "ios/chrome/common/ui_util/constraints_ui_util.h" #import "ios/chrome/common/ui_util/constraints_ui_util.h"
#include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/chrome/grit/ios_chromium_strings.h"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
...@@ -52,7 +53,7 @@ ...@@ -52,7 +53,7 @@
[contentView addSubview:_textLabel]; [contentView addSubview:_textLabel];
_button = [UIButton buttonWithType:UIButtonTypeCustom]; _button = [UIButton buttonWithType:UIButtonTypeCustom];
[_button setTitleColor:UIColorFromRGB(kTableViewTextLabelColorBlue) [_button setTitleColor:[UIColor colorNamed:kBlueColor]
forState:UIControlStateNormal]; forState:UIControlStateNormal];
_button.translatesAutoresizingMaskIntoConstraints = NO; _button.translatesAutoresizingMaskIntoConstraints = NO;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "ios/chrome/browser/ui/collection_view/cells/collection_view_cell_constants.h" #include "ios/chrome/browser/ui/collection_view/cells/collection_view_cell_constants.h"
#import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui_util/constraints_ui_util.h" #import "ios/chrome/common/ui_util/constraints_ui_util.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
...@@ -62,9 +63,7 @@ const CGFloat kVerticalSpacing = 16; ...@@ -62,9 +63,7 @@ const CGFloat kVerticalSpacing = 16;
_textLabel.font = _textLabel.font =
[UIFont preferredFontForTextStyle:kTableViewSublabelFontStyle]; [UIFont preferredFontForTextStyle:kTableViewSublabelFontStyle];
_textLabel.numberOfLines = 0; _textLabel.numberOfLines = 0;
_textLabel.textColor = _textLabel.textColor = UIColor.cr_secondaryLabelColor;
UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
_textLabel.backgroundColor = [UIColor clearColor];
_textLabel.textAlignment = NSTextAlignmentCenter; _textLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:_textLabel]; [self.contentView addSubview:_textLabel];
......
...@@ -69,6 +69,7 @@ source_set("google_services") { ...@@ -69,6 +69,7 @@ source_set("google_services") {
"//ios/chrome/browser/ui/signin_interaction", "//ios/chrome/browser/ui/signin_interaction",
"//ios/chrome/browser/ui/table_view", "//ios/chrome/browser/ui/table_view",
"//ios/chrome/browser/ui/util", "//ios/chrome/browser/ui/util",
"//ios/chrome/common/colors",
"//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser",
"//ios/public/provider/chrome/browser/images", "//ios/public/provider/chrome/browser/images",
"//ios/public/provider/chrome/browser/signin", "//ios/public/provider/chrome/browser/signin",
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h"
#import "ios/chrome/browser/ui/table_view/cells/table_view_image_item.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_image_item.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/UIColor+cr_semantic_colors.h"
#include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/chrome/grit/ios_chromium_strings.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/public/provider/chrome/browser/signin/chrome_identity.h" #import "ios/public/provider/chrome/browser/signin/chrome_identity.h"
...@@ -414,9 +415,7 @@ NSString* kGoogleServicesSyncErrorImage = @"google_services_sync_error"; ...@@ -414,9 +415,7 @@ NSString* kGoogleServicesSyncErrorImage = @"google_services_sync_error";
needsUpdate || self.manageSyncItem.enabled != !self.isSyncDisabled; needsUpdate || self.manageSyncItem.enabled != !self.isSyncDisabled;
self.manageSyncItem.enabled = !self.isSyncDisabled; self.manageSyncItem.enabled = !self.isSyncDisabled;
self.manageSyncItem.textColor = self.manageSyncItem.textColor =
self.manageSyncItem.enabled self.manageSyncItem.enabled ? nil : UIColor.cr_secondaryLabelColor;
? nil
: UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
return needsUpdate; return needsUpdate;
} }
if (!self.manageSyncItem) if (!self.manageSyncItem)
...@@ -619,7 +618,7 @@ NSString* kGoogleServicesSyncErrorImage = @"google_services_sync_error"; ...@@ -619,7 +618,7 @@ NSString* kGoogleServicesSyncErrorImage = @"google_services_sync_error";
item.title = GetNSString( item.title = GetNSString(
IDS_IOS_GOOGLE_SERVICES_SETTINGS_SYNC_DISABLBED_BY_ADMINISTRATOR_TITLE); IDS_IOS_GOOGLE_SERVICES_SETTINGS_SYNC_DISABLBED_BY_ADMINISTRATOR_TITLE);
item.enabled = NO; item.enabled = NO;
item.textColor = UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor); item.textColor = UIColor.cr_secondaryLabelColor;
return item; return item;
} }
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#import "ios/chrome/browser/ui/table_view/cells/table_view_image_item.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_image_item.h"
#import "ios/chrome/browser/ui/table_view/cells/table_view_item.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_item.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/UIColor+cr_semantic_colors.h"
#include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/chrome/grit/ios_chromium_strings.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -285,8 +286,7 @@ NSString* kGoogleServicesSyncErrorImage = @"google_services_sync_error"; ...@@ -285,8 +286,7 @@ NSString* kGoogleServicesSyncErrorImage = @"google_services_sync_error";
if (self.shouldEncryptionItemBeEnabled) { if (self.shouldEncryptionItemBeEnabled) {
self.encryptionItem.textColor = nil; self.encryptionItem.textColor = nil;
} else { } else {
self.encryptionItem.textColor = self.encryptionItem.textColor = UIColor.cr_secondaryLabelColor;
UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
} }
if (needsUpdate && notifyConsumer) { if (needsUpdate && notifyConsumer) {
[self.consumer reloadItem:self.self.encryptionItem]; [self.consumer reloadItem:self.self.encryptionItem];
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/ui_feature_flags.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
...@@ -78,6 +79,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -78,6 +79,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
self.shouldHideDoneButton = YES; self.shouldHideDoneButton = YES;
self.tableView.accessibilityIdentifier = self.tableView.accessibilityIdentifier =
kLanguageDetailsTableViewAccessibilityIdentifier; kLanguageDetailsTableViewAccessibilityIdentifier;
self.tableView.tintColor = [UIColor colorNamed:kBlueColor];
[self loadModel]; [self loadModel];
} }
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/ui_feature_flags.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
...@@ -423,7 +425,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -423,7 +425,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
self.addLanguageItem = addLanguageItem; self.addLanguageItem = addLanguageItem;
addLanguageItem.text = l10n_util::GetNSString( addLanguageItem.text = l10n_util::GetNSString(
IDS_IOS_LANGUAGE_SETTINGS_ADD_LANGUAGE_BUTTON_TITLE); IDS_IOS_LANGUAGE_SETTINGS_ADD_LANGUAGE_BUTTON_TITLE);
addLanguageItem.textColor = UIColorFromRGB(kTableViewTextLabelColorBlue); addLanguageItem.textColor = [UIColor colorNamed:kBlueColor];
addLanguageItem.accessibilityTraits |= UIAccessibilityTraitButton; addLanguageItem.accessibilityTraits |= UIAccessibilityTraitButton;
[self.tableViewModel addItem:addLanguageItem [self.tableViewModel addItem:addLanguageItem
toSectionWithIdentifier:SectionIdentifierLanguages]; toSectionWithIdentifier:SectionIdentifierLanguages];
...@@ -445,9 +447,9 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -445,9 +447,9 @@ typedef NS_ENUM(NSInteger, ItemType) {
- (void)setAddLanguageItemEnabled:(BOOL)enabled { - (void)setAddLanguageItemEnabled:(BOOL)enabled {
// Update the model. // Update the model.
self.addLanguageItem.enabled = enabled; self.addLanguageItem.enabled = enabled;
self.addLanguageItem.textColor = self.addLanguageItem.textColor = self.isEditing
self.isEditing ? UIColorFromRGB(kSettingsCellsDetailTextColor) ? UIColor.cr_secondaryLabelColor
: UIColorFromRGB(kTableViewTextLabelColorBlue); : [UIColor colorNamed:kBlueColor];
// Update the table view. // Update the table view.
[self reconfigureCellsForItems:@[ self.addLanguageItem ]]; [self reconfigureCellsForItems:@[ self.addLanguageItem ]];
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#import "ios/chrome/browser/ui/table_view/table_view_model.h" #import "ios/chrome/browser/ui/table_view/table_view_model.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/ui_feature_flags.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/UIColor+cr_semantic_colors.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/public/provider/chrome/browser/chrome_browser_provider.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h"
#import "ios/public/provider/chrome/browser/signin/chrome_identity.h" #import "ios/public/provider/chrome/browser/signin/chrome_identity.h"
...@@ -436,10 +437,9 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -436,10 +437,9 @@ typedef NS_ENUM(NSInteger, ItemType) {
? [UIImage imageNamed:@"settings_error"] ? [UIImage imageNamed:@"settings_error"]
: nil; : nil;
encryptionCellItem.enabled = [self shouldEncryptionItemBeEnabled]; encryptionCellItem.enabled = [self shouldEncryptionItemBeEnabled];
encryptionCellItem.textColor = encryptionCellItem.textColor = encryptionCellItem.enabled
encryptionCellItem.enabled ? UIColor.cr_labelColor
? UIColor.blackColor : UIColor.cr_secondaryLabelColor;
: UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
return encryptionCellItem; return encryptionCellItem;
} }
...@@ -889,8 +889,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -889,8 +889,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
: nil; : nil;
item.enabled = [self shouldEncryptionItemBeEnabled]; item.enabled = [self shouldEncryptionItemBeEnabled];
item.textColor = item.textColor =
item.enabled ? UIColor.blackColor item.enabled ? UIColor.cr_labelColor : UIColor.cr_secondaryLabelColor;
: UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
[self reconfigureCellsForItems:@[ item ]]; [self reconfigureCellsForItems:@[ item ]];
} }
......
...@@ -47,16 +47,6 @@ extern const CGFloat kTableViewLabelVerticalTopSpacing; ...@@ -47,16 +47,6 @@ extern const CGFloat kTableViewLabelVerticalTopSpacing;
// The width taken by the accessory view when it is displayed. // The width taken by the accessory view when it is displayed.
extern const CGFloat kTableViewAccessoryWidth; extern const CGFloat kTableViewAccessoryWidth;
// Hex Value for blue label text color.
extern const int kTableViewTextLabelColorBlue;
// Hex Value for light gray label text color.
extern const int kTableViewTextLabelColorLightGrey;
// Hex Value for the text color of the secondary labels (e.g. details, URL,
// metadata...).
extern const int kTableViewSecondaryLabelLightGrayTextColor;
// A masked password string(e.g. "••••••••"). // A masked password string(e.g. "••••••••").
extern NSString* const kMaskedPassword; extern NSString* const kMaskedPassword;
......
...@@ -22,8 +22,4 @@ const CGFloat kUseDefaultFontSize = 0.0; ...@@ -22,8 +22,4 @@ const CGFloat kUseDefaultFontSize = 0.0;
const CGFloat kTableViewLabelVerticalTopSpacing = 13.0; const CGFloat kTableViewLabelVerticalTopSpacing = 13.0;
const CGFloat kTableViewAccessoryWidth = 40; const CGFloat kTableViewAccessoryWidth = 40;
const int kTableViewTextLabelColorBlue = 0x1A73E8;
const int kTableViewTextLabelColorLightGrey = 0x6D6D72;
const int kTableViewSecondaryLabelLightGrayTextColor = 0x5F6368;
NSString* const kMaskedPassword = @"••••••••"; NSString* const kMaskedPassword = @"••••••••";
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
@property(nonatomic, strong) NSString* text; @property(nonatomic, strong) NSString* text;
// UIColor for the cell's detailTextLabel. Default is // UIColor for the cell's detailTextLabel. Default is
// kTableViewSecondaryLabelLightGrayTextColor. // UIColor.cr_secondaryLabelColor.
@property(nonatomic, strong) UIColor* detailTextColor; @property(nonatomic, strong) UIColor* detailTextColor;
// Detail text to be displayed. // Detail text to be displayed.
@property(nonatomic, strong) NSString* detailText; @property(nonatomic, strong) NSString* detailText;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
@property(nonatomic, strong) UIColor* textColor; @property(nonatomic, strong) UIColor* textColor;
// UIColor for the cell's detailTextLabel. If not set, // UIColor for the cell's detailTextLabel. If not set,
// kTableViewSecondaryLabelLightGrayTextColor is used. // UIColor.cr_secondaryLabelColor is used.
@property(nonatomic, strong) UIColor* detailTextColor; @property(nonatomic, strong) UIColor* detailTextColor;
// Detail text to be displayed. The detail text label is configured wiht // Detail text to be displayed. The detail text label is configured wiht
// multiline (no limit). // multiline (no limit).
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
@property(nonatomic, assign) NSTextAlignment textAlignment; @property(nonatomic, assign) NSTextAlignment textAlignment;
// UIColor for the cell's textLabel. Default is // UIColor for the cell's textLabel. Default is
// kTableViewTextLabelColorLightGrey. ChromeTableViewStyler's |cellTitleColor| // UIColor.cr_labelColor. ChromeTableViewStyler's |cellTitleColor|
// takes precedence over the default color, but not over |textColor|. // takes precedence over the default color, but not over |textColor|.
@property(nonatomic, strong) UIColor* textColor; @property(nonatomic, strong) UIColor* textColor;
......
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