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

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

Issue 316019: Increase visual spacing between browser action buttons to 5px. (Closed)
Patch Set: cr change 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 | « chrome/browser/gtk/browser_actions_toolbar_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/browser_actions_container.cc
diff --git a/chrome/browser/views/browser_actions_container.cc b/chrome/browser/views/browser_actions_container.cc
index 5dbf6ad31be80cb5c88d082f6806081418c0572f..d21984b1d1cbd3bcb05f3808425f599db855942e 100644
--- a/chrome/browser/views/browser_actions_container.cc
+++ b/chrome/browser/views/browser_actions_container.cc
@@ -30,6 +30,11 @@ static const int kButtonSize = 29;
// The padding between the browser actions and the omnibox/page menu.
static const int kHorizontalPadding = 4;
+// The padding between browser action buttons. Visually, the actual number of
+// empty (non-drawing) pixels is this value + 2 when adjacent browser icons
+// use their maximum allowed size.
+static const int kBrowserActionButtonPadding = 3;
+
// This is the same value from toolbar.cc. We position the browser actions
// container flush with the edges of the toolbar as a special case so that we
// can draw the badge outside the visual bounds of the container.
@@ -340,13 +345,16 @@ gfx::Size BrowserActionsContainer::GetPreferredSize() {
return gfx::Size(0, 0);
int width = kHorizontalPadding * 2 +
browser_action_views_.size() * kButtonSize;
+ if (browser_action_views_.size() > 1)
+ width += (browser_action_views_.size() - 1) * kBrowserActionButtonPadding;
return gfx::Size(width, kButtonSize);
}
void BrowserActionsContainer::Layout() {
for (size_t i = 0; i < browser_action_views_.size(); ++i) {
BrowserActionView* view = browser_action_views_[i];
- int x = kHorizontalPadding + i * kButtonSize;
+ int x = kHorizontalPadding +
+ i * (kButtonSize + kBrowserActionButtonPadding);
if (x + kButtonSize <= width()) {
view->SetBounds(x, 0, kButtonSize, height());
view->SetVisible(true);
« no previous file with comments | « chrome/browser/gtk/browser_actions_toolbar_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698