diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 17:17:20 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 17:17:20 +0000 |
commit | 049529c6d759733653d7f86d3d89ca941270cc69 (patch) | |
tree | 1b954d583aa60aa83a55a094522fe3555028c248 | |
parent | 4859e61799fd864f315173ca997f7fbb7849e020 (diff) | |
download | chromium_src-049529c6d759733653d7f86d3d89ca941270cc69.zip chromium_src-049529c6d759733653d7f86d3d89ca941270cc69.tar.gz chromium_src-049529c6d759733653d7f86d3d89ca941270cc69.tar.bz2 |
Fix the layout of control buttons on notification.
Adjust margin and fixed horizontal alignment.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1687009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45454 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/notifications/balloon_view.cc | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/notifications/balloon_view.cc b/chrome/browser/chromeos/notifications/balloon_view.cc index 0a4a93b..b2cf05a 100644 --- a/chrome/browser/chromeos/notifications/balloon_view.cc +++ b/chrome/browser/chromeos/notifications/balloon_view.cc @@ -38,7 +38,11 @@ namespace { const int kRevokePermissionCommand = 0; // Vertical margin between close button and menu button. -const int kControlButtonsMargin = 4; +const int kControlButtonsMargin = 6; + +// Top, Right margin for notification control view. +const int kControlViewTopMargin = 4; +const int kControlViewRightMargin = 6; } // namespace namespace chromeos { @@ -86,12 +90,16 @@ class NotificationControlView : public views::View, // The control view will never be resized, so just layout once. gfx::Size options_size = options_menu_button_->GetPreferredSize(); + gfx::Size button_size = close_button_->GetPreferredSize(); + + int height = std::max(options_size.height(), button_size.height()); options_menu_button_->SetBounds( - 0, 0, options_size.width(), options_size.height()); + 0, (height - options_size.height()) / 2, + options_size.width(), options_size.height()); - gfx::Size button_size = close_button_->GetPreferredSize(); close_button_->SetBounds( - options_size.width() + kControlButtonsMargin, 0, + options_size.width() + kControlButtonsMargin, + (height - button_size.height()) / 2, button_size.width(), button_size.height()); SizeToPreferredSize(); @@ -298,7 +306,9 @@ void BalloonViewImpl::Activated() { control_view_host_->GetRootView()->GetChildViewAt(0)->GetPreferredSize(); control_view_host_->Show(); control_view_host_->SetBounds( - gfx::Rect(width() - size.width(), 0, size.width(), size.height())); + gfx::Rect(width() - size.width() - kControlViewRightMargin, + kControlViewTopMargin, + size.width(), size.height())); } void BalloonViewImpl::Deactivated() { |