Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: ui/message_center/views/notification_view.cc

Issue 256883002: Update notification style: allow 2-line titles if the message is blank. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix rsesek comments. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/views/constants.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/notification_view.cc
diff --git a/ui/message_center/views/notification_view.cc b/ui/message_center/views/notification_view.cc
index 10573eddc8382bc63da327d72fa731f8073bd990..8157e181c92fdecf6f16e462d5de378a2ad5e127 100644
--- a/ui/message_center/views/notification_view.cc
+++ b/ui/message_center/views/notification_view.cc
@@ -323,11 +323,15 @@ NotificationView::NotificationView(MessageCenterController* controller,
const gfx::FontList& font_list =
default_label_font_list.DeriveWithSizeDelta(2);
int padding = kTitleLineHeight - font_list.GetHeight();
+ int title_lines = notification.message().empty() ? kTitleNoMessageLineLimit
+ : kTitleLineLimit;
+ int title_character_limit =
+ kNotificationWidth * title_lines / kMinPixelsPerTitleCharacter;
title_view_ = new BoundedLabel(
- gfx::TruncateString(notification.title(), kTitleCharacterLimit),
+ gfx::TruncateString(notification.title(), title_character_limit),
font_list);
title_view_->SetLineHeight(kTitleLineHeight);
- title_view_->SetLineLimit(message_center::kTitleLineLimit);
+ title_view_->SetLineLimit(title_lines);
title_view_->SetColors(message_center::kRegularTextColor,
kRegularTextBackgroundColor);
title_view_->SetBorder(MakeTextBorder(padding, 3, 0));
« no previous file with comments | « ui/message_center/views/constants.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698