diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-27 18:01:47 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-27 18:01:47 +0000 |
commit | a4a4ffde20dff2c18909c738fdb84e0c8f68007c (patch) | |
tree | 2e853ee6ab023229e03660604ac150c7a84fd57c /chrome/browser | |
parent | d04d82cbaf02508766904594da4ecbff7960c4b6 (diff) | |
download | chromium_src-a4a4ffde20dff2c18909c738fdb84e0c8f68007c.zip chromium_src-a4a4ffde20dff2c18909c738fdb84e0c8f68007c.tar.gz chromium_src-a4a4ffde20dff2c18909c738fdb84e0c8f68007c.tar.bz2 |
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
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/views/location_bar_view.cc | 10 |
1 files changed, 8 insertions, 2 deletions
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( |