diff options
author | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-01 05:03:53 +0000 |
---|---|---|
committer | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-01 05:03:53 +0000 |
commit | 7dc839eece7c828d265ba1d8d510ad5b71d1db99 (patch) | |
tree | 57f14c02b6108c5a0fd330ee75f039855fa7b27d /ui/views/bubble | |
parent | cd1d651b3470728e5b7a3c8dae528060c81d12a5 (diff) | |
download | chromium_src-7dc839eece7c828d265ba1d8d510ad5b71d1db99.zip chromium_src-7dc839eece7c828d265ba1d8d510ad5b71d1db99.tar.gz chromium_src-7dc839eece7c828d265ba1d8d510ad5b71d1db99.tar.bz2 |
Fix BubbleFrameView titlebar sizing.
My http://crrev.com/202479 caused a regression in BubbleFrameView sizing.
Bubbles try to accommodate non-existent titles, close buttons, and extra views.
Only accommodate these titlebar view widths if they are present.
BUG=245443
TEST=Small bubbles (like ash launcher tooltips) shouldn't have extra padding.
R=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/16154010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203589 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/bubble')
-rw-r--r-- | ui/views/bubble/bubble_frame_view.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc index a6e56ad..c0fb749 100644 --- a/ui/views/bubble/bubble_frame_view.cc +++ b/ui/views/bubble/bubble_frame_view.cc @@ -141,9 +141,11 @@ gfx::Size BubbleFrameView::GetPreferredSize() { const gfx::Size client(GetWidget()->client_view()->GetPreferredSize()); gfx::Size size(GetUpdatedWindowBounds(gfx::Rect(), client, false).size()); // Accommodate the width of the title bar elements. - int title_bar_width = GetInsets().width() + border()->GetInsets().width() + - kTitleLeftInset + title_->GetPreferredSize().width() + - close_->width() + 1; + int title_bar_width = GetInsets().width() + border()->GetInsets().width(); + if (!title_->text().empty()) + title_bar_width += kTitleLeftInset + title_->GetPreferredSize().width(); + if (close_->visible()) + title_bar_width += close_->width() + 1; if (titlebar_extra_view_ != NULL) title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); size.SetToMax(gfx::Size(title_bar_width, 0)); |