summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-02 21:39:46 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-02 21:39:46 +0000
commit90b1ffdc4ac197c6359e602d6e47405e1bef6612 (patch)
tree0819d63fcd9d61f3243800dc717a4a26c0db91d1 /ash
parent69fe7ac63462d2ce5614bacce30eade1262169e5 (diff)
downloadchromium_src-90b1ffdc4ac197c6359e602d6e47405e1bef6612.zip
chromium_src-90b1ffdc4ac197c6359e602d6e47405e1bef6612.tar.gz
chromium_src-90b1ffdc4ac197c6359e602d6e47405e1bef6612.tar.bz2
Enables to render the tray_display message multiline.
BUG=167348 TEST=set UI language to Malayalam, login with an external display, open the system tray and see whole the message for display is shown. Review URL: https://chromiumcodereview.appspot.com/11663016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174862 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/system/chromeos/tray_display.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/ash/system/chromeos/tray_display.cc b/ash/system/chromeos/tray_display.cc
index 51c1f33..f7ca5a6 100644
--- a/ash/system/chromeos/tray_display.cc
+++ b/ash/system/chromeos/tray_display.cc
@@ -36,12 +36,14 @@ class DisplayView : public ash::internal::ActionableView {
ash::kTrayPopupPaddingBetweenItems));
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
- views::ImageView* image =
+ image_ =
new ash::internal::FixedSizedImageView(0, ash::kTrayPopupItemHeight);
- image->SetImage(
+ image_->SetImage(
bundle.GetImageNamed(IDR_AURA_UBER_TRAY_DISPLAY).ToImageSkia());
- AddChildView(image);
+ AddChildView(image_);
label_ = new views::Label();
+ label_->SetMultiLine(true);
+ label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
AddChildView(label_);
Update();
}
@@ -108,7 +110,15 @@ class DisplayView : public ash::internal::ActionableView {
return true;
}
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) {
+ int label_max_width = bounds().width() - kTrayPopupPaddingHorizontal * 2 -
+ kTrayPopupPaddingBetweenItems - image_->GetPreferredSize().width();
+ label_->SizeToFit(label_max_width);
+ PreferredSizeChanged();
+ }
+
user::LoginStatus login_status_;
+ views::ImageView* image_;
views::Label* label_;
DISALLOW_COPY_AND_ASSIGN(DisplayView);