Commit cf782b84 authored by thakis@chromium.org's avatar thakis@chromium.org

mac: Make notification text colors match views.

Notification titles and button text is drawn in kRegularTextColor, notifcation
message text is drawn in kDimTextColor.

Move kDimTextColor to message_center_style so that it can be shared.

BUG=240877
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/16075002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202628 0039d316-1c4b-4281-b951-d872f2087c98
parent 213716ea
......@@ -62,9 +62,10 @@
frame.size.width -= offsetX;
NSDictionary* attributes = @{
NSFontAttributeName : [title attribute:NSFontAttributeName
atIndex:0
effectiveRange:NULL],
NSFontAttributeName :
[title attribute:NSFontAttributeName atIndex:0 effectiveRange:NULL],
NSForegroundColorAttributeName :
gfx::SkColorToDeviceNSColor(message_center::kRegularTextColor),
};
[[title string] drawWithRect:frame
options:(NSStringDrawingUsesLineFragmentOrigin |
......@@ -344,6 +345,8 @@
frame.size.height = 0;
title_.reset([self newLabelWithFrame:frame]);
[title_ setAutoresizingMask:NSViewMinYMargin];
[title_ setTextColor:gfx::SkColorToCalibratedNSColor(
message_center::kRegularTextColor)];
[title_ setFont:[NSFont messageFontOfSize:message_center::kTitleFontSize]];
}
......@@ -352,6 +355,8 @@
frame.size.height = 0;
message_.reset([self newLabelWithFrame:frame]);
[message_ setAutoresizingMask:NSViewMinYMargin];
[message_ setTextColor:gfx::SkColorToCalibratedNSColor(
message_center::kDimTextColor)];
[message_ setFont:
[NSFont messageFontOfSize:message_center::kMessageFontSize]];
}
......@@ -362,8 +367,6 @@
[label setBezeled:NO];
[label setEditable:NO];
[label setSelectable:NO];
[label setTextColor:gfx::SkColorToCalibratedNSColor(
message_center::kRegularTextColor)];
return label;
}
......
......@@ -37,6 +37,7 @@ const int kMessageLineHeight = 18;
const SkColor kNotificationBackgroundColor = SkColorSetRGB(255, 255, 255);
const SkColor kLegacyIconBackgroundColor = SkColorSetRGB(0xf5, 0xf5, 0xf5);
const SkColor kRegularTextColor = SkColorSetRGB(34, 34, 34);
const SkColor kDimTextColor = SkColorSetRGB(102, 102, 102);
const SkColor kFocusBorderColor = SkColorSetRGB(64, 128, 250);
// Limits.
......
......@@ -43,6 +43,7 @@ extern const SkColor kNotificationBackgroundColor; // Background of the card.
extern const SkColor kLegacyIconBackgroundColor; // Used behind icons smaller.
// than the icon view.
extern const SkColor kRegularTextColor; // Title, message, ...
extern const SkColor kDimTextColor;
extern const SkColor kFocusBorderColor; // The focus border.
// Limits.
......
......@@ -59,7 +59,6 @@ const size_t kMessageCharacterLimit =
// view::Label from modifying the text color and will not actually be drawn.
// See view::Label's RecalculateColors() for details.
const SkColor kRegularTextBackgroundColor = SK_ColorWHITE;
const SkColor kDimTextColor = SkColorSetRGB(102, 102, 102);
const SkColor kDimTextBackgroundColor = SK_ColorWHITE;
// static
......@@ -145,7 +144,7 @@ ItemView::ItemView(const message_center::NotificationItem& item) {
views::Label* message = new views::Label(item.message);
message->set_collapse_when_hidden(true);
message->SetHorizontalAlignment(gfx::ALIGN_LEFT);
message->SetEnabledColor(kDimTextColor);
message->SetEnabledColor(message_center::kDimTextColor);
message->SetBackgroundColor(kDimTextBackgroundColor);
AddChildView(message);
......@@ -415,7 +414,8 @@ NotificationView::NotificationView(const Notification& notification,
ui::TruncateString(notification.message(), kMessageCharacterLimit));
message_view_->SetLineHeight(kMessageLineHeight);
message_view_->SetVisible(!is_expanded() || !notification.items().size());
message_view_->SetColors(kDimTextColor, kDimTextBackgroundColor);
message_view_->SetColors(message_center::kDimTextColor,
kDimTextBackgroundColor);
message_view_->set_border(MakeTextBorder(padding, 4, 0));
top_view_->AddChildView(message_view_);
accessible_lines.push_back(notification.message());
......
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