From a4a4ffde20dff2c18909c738fdb84e0c8f68007c Mon Sep 17 00:00:00 2001 From: "finnur@chromium.org" Date: Tue, 27 Oct 2009 18:01:47 +0000 Subject: Page action pixel-god appeasement (better positioning and spacing for the page action icons). BUG=25708 TEST=Visual inspection. See bug. Review URL: http://codereview.chromium.org/329028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30218 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/location_bar_view.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'chrome/browser') diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index 3e3c433..2d32c52 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -43,7 +43,7 @@ static const int kEntryPadding = 3; static const int kInnerPadding = 3; // The size (both dimensions) of the buttons for page actions. -static const int kPageActionButtonSize = 29; +static const int kPageActionButtonSize = 19; static const SkBitmap* kBackground = NULL; @@ -102,7 +102,13 @@ LocationBarView::PageActionWithBadgeView::PageActionWithBadgeView( } void LocationBarView::PageActionWithBadgeView::Layout() { - image_view_->SetBounds(0, 0, width(), height()); + // We have 25 pixels of vertical space in the Omnibox to play with, so even + // sized icons (such as 16x16) have either a 5 or a 4 pixel whitespace + // (padding) above and below. It looks better to have the extra pixel above + // the icon than below it, so we add a pixel. http://crbug.com/25708. + const SkBitmap& image = image_view()->GetImage(); + int y = (image.height() + 1) % 2; // Even numbers: 1px padding. Odd: 0px. + image_view_->SetBounds(0, y, width(), height()); } void LocationBarView::PageActionWithBadgeView::PaintChildren( -- cgit v1.1