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

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

Issue 14322007: Add line height setting to views::Label & use it for notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
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 597ac9633726d8beaac5507967d909417a6ee518..f35aaf1f38c71922555d3a1a4648e0ce5ae1010f 100644
--- a/ui/message_center/views/notification_view.cc
+++ b/ui/message_center/views/notification_view.cc
@@ -399,6 +399,7 @@ NotificationView::NotificationView(const Notification& notification,
if (!notification.message().empty()) {
message_view_ = new BoundedLabel(
ui::TruncateString(notification.message(), kMessageCharacterLimit));
+ message_view_->SetLineHeight(kMessageLineHeight);
message_view_->SetVisible(!is_expanded() || !notification.items().size());
message_view_->SetColors(kDimTextColor, kDimTextBackgroundColor);
message_view_->set_border(MakeTextBorder(4, 1));
@@ -494,7 +495,7 @@ int NotificationView::GetHeightForWidth(int width) {
// line limit would be different for the specified width than it currently is.
// TODO(dharcourt): Avoid BoxLayout and directly compute the correct height.
if (message_view_ && title_view_) {
- int used_limit = message_view_->line_limit();
+ int used_limit = message_view_->GetLineLimit();
int correct_limit = GetMessageLineLimit(width);
if (used_limit != correct_limit) {
total_height -= GetMessageHeight(content_width, used_limit);

Powered by Google App Engine
This is Rietveld 408576698