summaryrefslogtreecommitdiffstats
path: root/ui/message_center/base_format_view.cc
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-27 01:16:59 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-27 01:16:59 +0000
commitb6e0151477e882331a77247c520b0d4a370a68aa (patch)
tree3cad28c387056a29571ab567d7e696439df2a8f9 /ui/message_center/base_format_view.cc
parent2f663eef6da534a195b0cf06f4242d4176c1bd5b (diff)
downloadchromium_src-b6e0151477e882331a77247c520b0d4a370a68aa.zip
chromium_src-b6e0151477e882331a77247c520b0d4a370a68aa.tar.gz
chromium_src-b6e0151477e882331a77247c520b0d4a370a68aa.tar.bz2
Calls SizeToFit() method for multi-lined Labels to return correct height.
BUG=162146 Review URL: https://chromiumcodereview.appspot.com/11417129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center/base_format_view.cc')
-rw-r--r--ui/message_center/base_format_view.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/message_center/base_format_view.cc b/ui/message_center/base_format_view.cc
index 6f1790e..027c724 100644
--- a/ui/message_center/base_format_view.cc
+++ b/ui/message_center/base_format_view.cc
@@ -63,6 +63,9 @@ void BaseFormatView::SetUpView() {
message->SetHorizontalAlignment(gfx::ALIGN_LEFT);
message->SetMultiLine(true);
message->SetElideBehavior(views::Label::ELIDE_AT_END);
+ message->SizeToFit(
+ kBaseFormatButtonWidth * 2 + kBaseFormatPaddingBetweenItems * 3 +
+ kBaseFormatTimestampWidth);
views::Label* timestamp = NULL;
if (notification_.timestamp != base::Time()) {
@@ -92,6 +95,8 @@ void BaseFormatView::SetUpView() {
notification_.expanded_message);
expanded_message->SetHorizontalAlignment(gfx::ALIGN_LEFT);
expanded_message->SetMultiLine(true);
+ expanded_message->SizeToFit(
+ kBaseFormatButtonWidth * 2 + kBaseFormatPaddingBetweenItems);
// TODO(miket): Image thumbnail for image-type notifications (imageUrl)