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

Unified Diff: ash/system/tray/tray_details_view.cc

Issue 10332152: Add TraySms for SMS messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bubble sizing code Created 8 years, 7 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 | « ash/system/tray/tray_constants.cc ('k') | ash/system/tray/tray_views.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_details_view.cc
diff --git a/ash/system/tray/tray_details_view.cc b/ash/system/tray/tray_details_view.cc
index 2d1d1cd0fd6542c2fb035884d4368a6cab43ae97..2b6e74a9b74bb7d4ecbe4b6c0d0734f6f641664f 100644
--- a/ash/system/tray/tray_details_view.cc
+++ b/ash/system/tray/tray_details_view.cc
@@ -59,23 +59,19 @@ void TrayDetailsView::Layout() {
scroller_->set_fixed_size(gfx::Size());
gfx::Size size = GetPreferredSize();
- if (size.height() < height()) {
- // The available size is larger than the requested size. In this case, do
- // the normal layout, then make sure the footer element is bottom aligned.
- views::View::Layout();
- gfx::Rect fbounds = footer_->bounds();
- fbounds.set_y(height() - footer_->height());
- footer_->SetBoundsRect(fbounds);
- } else {
+ if (size.height() > height()) {
// The available size is smaller than the requested size. Squeeze the
- // scroller so that everything fits in the available size, and then do the
- // normal layout.
+ // scroller so that everything fits in the available size.
gfx::Size scroller_size = scroll_content_->GetPreferredSize();
scroller_->set_fixed_size(gfx::Size(
width() + scroller_->GetScrollBarWidth(),
scroller_size.height() - (size.height() - height())));
- views::View::Layout();
}
+ views::View::Layout();
+ // Always make sure the footer element is bottom aligned.
+ gfx::Rect fbounds = footer_->bounds();
+ fbounds.set_y(height() - footer_->height());
+ footer_->SetBoundsRect(fbounds);
}
} // namespace internal
« no previous file with comments | « ash/system/tray/tray_constants.cc ('k') | ash/system/tray/tray_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698