diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-17 00:45:08 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-17 00:45:08 +0000 |
commit | 53b35b1ad9587c497a693ef57940b392bf9390dc (patch) | |
tree | 1b2ab9beefdba71b75a9f12ccbc8a1108466bdf7 /ash/system/audio | |
parent | eedff55de48a12a7d61abf7b71601c7d48ee3f64 (diff) | |
download | chromium_src-53b35b1ad9587c497a693ef57940b392bf9390dc.zip chromium_src-53b35b1ad9587c497a693ef57940b392bf9390dc.tar.gz chromium_src-53b35b1ad9587c497a693ef57940b392bf9390dc.tar.bz2 |
ash: Make sure all the popups from the tray have the same width.
This should keep things sane and good if username, email, network name etc. are too long.
This also fixes alignment/padding issues for the sliders, chevron icons etc.
BUG=110130
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9703125
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127312 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/audio')
-rw-r--r-- | ash/system/audio/tray_volume.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ash/system/audio/tray_volume.cc b/ash/system/audio/tray_volume.cc index 45d1d1d..e02fd1a 100644 --- a/ash/system/audio/tray_volume.cc +++ b/ash/system/audio/tray_volume.cc @@ -98,7 +98,7 @@ class VolumeView : public views::View, public: VolumeView() { SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, - 0, 0, 5)); + kTrayPopupPaddingHorizontal, 0, kTrayPopupPaddingBetweenItems)); icon_ = new VolumeButton(this); AddChildView(icon_); @@ -107,7 +107,6 @@ class VolumeView : public views::View, ash::Shell::GetInstance()->tray_delegate(); slider_ = new views::Slider(this, views::Slider::HORIZONTAL); slider_->SetValue(delegate->GetVolumeLevel()); - slider_->set_border(views::Border::CreateEmptyBorder(0, 0, 0, 20)); AddChildView(slider_); } @@ -122,6 +121,12 @@ class VolumeView : public views::View, } private: + // Overridden from views::View. + virtual void OnBoundsChanged(const gfx::Rect& old_bounds) OVERRIDE { + int w = width() - slider_->x(); + slider_->SetSize(gfx::Size(w, slider_->height())); + } + // Overridden from views::ButtonListener. virtual void ButtonPressed(views::Button* sender, const views::Event& event) OVERRIDE { |