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

Unified Diff: chrome/browser/views/location_bar_view.cc

Issue 329028: Page action pixel-god appeasement.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/location_bar_view.cc
===================================================================
--- chrome/browser/views/location_bar_view.cc (revision 30215)
+++ chrome/browser/views/location_bar_view.cc (working copy)
@@ -43,7 +43,7 @@
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 @@
}
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(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698