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 @@
#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/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"
#include "ios/chrome/grit/ios_chromium_strings.h"
#include "ui/base/l10n/l10n_util_mac.h"
......@@ -52,7 +53,7 @@
[contentView addSubview:_textLabel];
_button = [UIButton buttonWithType:UIButtonTypeCustom];
[_button setTitleColor:UIColorFromRGB(kTableViewTextLabelColorBlue)
[_button setTitleColor:[UIColor colorNamed:kBlueColor]
forState:UIControlStateNormal];
_button.translatesAutoresizingMaskIntoConstraints = NO;
......
......@@ -7,6 +7,7 @@
#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/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"
#include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util_mac.h"
......@@ -62,9 +63,7 @@ const CGFloat kVerticalSpacing = 16;
_textLabel.font =
[UIFont preferredFontForTextStyle:kTableViewSublabelFontStyle];
_textLabel.numberOfLines = 0;
_textLabel.textColor =
UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
_textLabel.backgroundColor = [UIColor clearColor];
_textLabel.textColor = UIColor.cr_secondaryLabelColor;
_textLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:_textLabel];
......
......@@ -69,6 +69,7 @@ source_set("google_services") {
"//ios/chrome/browser/ui/signin_interaction",
"//ios/chrome/browser/ui/table_view",
"//ios/chrome/browser/ui/util",
"//ios/chrome/common/colors",
"//ios/public/provider/chrome/browser",
"//ios/public/provider/chrome/browser/images",
"//ios/public/provider/chrome/browser/signin",
......
......@@ -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_image_item.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_strings.h"
#import "ios/public/provider/chrome/browser/signin/chrome_identity.h"
......@@ -414,9 +415,7 @@ NSString* kGoogleServicesSyncErrorImage = @"google_services_sync_error";
needsUpdate || self.manageSyncItem.enabled != !self.isSyncDisabled;
self.manageSyncItem.enabled = !self.isSyncDisabled;
self.manageSyncItem.textColor =
self.manageSyncItem.enabled
? nil
: UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
self.manageSyncItem.enabled ? nil : UIColor.cr_secondaryLabelColor;
return needsUpdate;
}
if (!self.manageSyncItem)
......@@ -619,7 +618,7 @@ NSString* kGoogleServicesSyncErrorImage = @"google_services_sync_error";
item.title = GetNSString(
IDS_IOS_GOOGLE_SERVICES_SETTINGS_SYNC_DISABLBED_BY_ADMINISTRATOR_TITLE);
item.enabled = NO;
item.textColor = UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
item.textColor = UIColor.cr_secondaryLabelColor;
return item;
}
......
......@@ -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_item.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_strings.h"
#include "ui/base/l10n/l10n_util.h"
......@@ -285,8 +286,7 @@ NSString* kGoogleServicesSyncErrorImage = @"google_services_sync_error";
if (self.shouldEncryptionItemBeEnabled) {
self.encryptionItem.textColor = nil;
} else {
self.encryptionItem.textColor =
UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
self.encryptionItem.textColor = UIColor.cr_secondaryLabelColor;
}
if (needsUpdate && notifyConsumer) {
[self.consumer reloadItem:self.self.encryptionItem];
......
......@@ -15,6 +15,7 @@
#import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h"
#include "ios/chrome/browser/ui/ui_feature_flags.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 "ui/base/l10n/l10n_util_mac.h"
......@@ -78,6 +79,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
self.shouldHideDoneButton = YES;
self.tableView.accessibilityIdentifier =
kLanguageDetailsTableViewAccessibilityIdentifier;
self.tableView.tintColor = [UIColor colorNamed:kBlueColor];
[self loadModel];
}
......
......@@ -23,6 +23,8 @@
#import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h"
#include "ios/chrome/browser/ui/ui_feature_flags.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 "ui/base/l10n/l10n_util_mac.h"
......@@ -423,7 +425,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
self.addLanguageItem = addLanguageItem;
addLanguageItem.text = l10n_util::GetNSString(
IDS_IOS_LANGUAGE_SETTINGS_ADD_LANGUAGE_BUTTON_TITLE);
addLanguageItem.textColor = UIColorFromRGB(kTableViewTextLabelColorBlue);
addLanguageItem.textColor = [UIColor colorNamed:kBlueColor];
addLanguageItem.accessibilityTraits |= UIAccessibilityTraitButton;
[self.tableViewModel addItem:addLanguageItem
toSectionWithIdentifier:SectionIdentifierLanguages];
......@@ -445,9 +447,9 @@ typedef NS_ENUM(NSInteger, ItemType) {
- (void)setAddLanguageItemEnabled:(BOOL)enabled {
// Update the model.
self.addLanguageItem.enabled = enabled;
self.addLanguageItem.textColor =
self.isEditing ? UIColorFromRGB(kSettingsCellsDetailTextColor)
: UIColorFromRGB(kTableViewTextLabelColorBlue);
self.addLanguageItem.textColor = self.isEditing
? UIColor.cr_secondaryLabelColor
: [UIColor colorNamed:kBlueColor];
// Update the table view.
[self reconfigureCellsForItems:@[ self.addLanguageItem ]];
......
......@@ -47,6 +47,7 @@
#import "ios/chrome/browser/ui/table_view/table_view_model.h"
#include "ios/chrome/browser/ui/ui_feature_flags.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"
#import "ios/public/provider/chrome/browser/chrome_browser_provider.h"
#import "ios/public/provider/chrome/browser/signin/chrome_identity.h"
......@@ -436,10 +437,9 @@ typedef NS_ENUM(NSInteger, ItemType) {
? [UIImage imageNamed:@"settings_error"]
: nil;
encryptionCellItem.enabled = [self shouldEncryptionItemBeEnabled];
encryptionCellItem.textColor =
encryptionCellItem.enabled
? UIColor.blackColor
: UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
encryptionCellItem.textColor = encryptionCellItem.enabled
? UIColor.cr_labelColor
: UIColor.cr_secondaryLabelColor;
return encryptionCellItem;
}
......@@ -889,8 +889,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
: nil;
item.enabled = [self shouldEncryptionItemBeEnabled];
item.textColor =
item.enabled ? UIColor.blackColor
: UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
item.enabled ? UIColor.cr_labelColor : UIColor.cr_secondaryLabelColor;
[self reconfigureCellsForItems:@[ item ]];
}
......
......@@ -47,16 +47,6 @@ extern const CGFloat kTableViewLabelVerticalTopSpacing;
// The width taken by the accessory view when it is displayed.
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. "••••••••").
extern NSString* const kMaskedPassword;
......
......@@ -22,8 +22,4 @@ const CGFloat kUseDefaultFontSize = 0.0;
const CGFloat kTableViewLabelVerticalTopSpacing = 13.0;
const CGFloat kTableViewAccessoryWidth = 40;
const int kTableViewTextLabelColorBlue = 0x1A73E8;
const int kTableViewTextLabelColorLightGrey = 0x6D6D72;
const int kTableViewSecondaryLabelLightGrayTextColor = 0x5F6368;
NSString* const kMaskedPassword = @"••••••••";
......@@ -25,7 +25,7 @@
@property(nonatomic, strong) NSString* text;
// UIColor for the cell's detailTextLabel. Default is
// kTableViewSecondaryLabelLightGrayTextColor.
// UIColor.cr_secondaryLabelColor.
@property(nonatomic, strong) UIColor* detailTextColor;
// Detail text to be displayed.
@property(nonatomic, strong) NSString* detailText;
......
......@@ -22,7 +22,7 @@
@property(nonatomic, strong) UIColor* textColor;
// UIColor for the cell's detailTextLabel. If not set,
// kTableViewSecondaryLabelLightGrayTextColor is used.
// UIColor.cr_secondaryLabelColor is used.
@property(nonatomic, strong) UIColor* detailTextColor;
// Detail text to be displayed. The detail text label is configured wiht
// multiline (no limit).
......
......@@ -17,7 +17,7 @@
@property(nonatomic, assign) NSTextAlignment textAlignment;
// 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|.
@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