summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 20:42:22 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 20:42:22 +0000
commitda942ea95144401b73956ae64f59157a7fcb23e9 (patch)
tree2d95d268e5b6dbefe20c6d3579956a56b53f1feb /chrome
parent47e92e3e136a4a6bf6ade75b2cda879e1edf54ad (diff)
downloadchromium_src-da942ea95144401b73956ae64f59157a7fcb23e9.zip
chromium_src-da942ea95144401b73956ae64f59157a7fcb23e9.tar.gz
chromium_src-da942ea95144401b73956ae64f59157a7fcb23e9.tar.bz2
Tweak the padding around toolstrips on the extension shelf.
Review URL: http://codereview.chromium.org/113051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/extension_shelf.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/chrome/browser/extensions/extension_shelf.cc b/chrome/browser/extensions/extension_shelf.cc
index 07cfdf4..1668252 100644
--- a/chrome/browser/extensions/extension_shelf.cc
+++ b/chrome/browser/extensions/extension_shelf.cc
@@ -16,21 +16,24 @@
namespace {
// Margins around the content.
-static const int kTopMargin = 1;
+static const int kTopMargin = 2;
static const int kBottomMargin = 2;
-static const int kLeftMargin = 1;
-static const int kRightMargin = 1;
+static const int kLeftMargin = 0;
+static const int kRightMargin = 0;
-// Padding between extension toolstrips.
+// Padding on left and right side of an extension toolstrip.
static const int kToolstripPadding = 2;
+// Width of the toolstrip divider.
+static const int kToolstripDividerWidth = 2;
+
// Preferred height of the ExtensionShelf.
static const int kShelfHeight = 29;
// Colors for the ExtensionShelf.
static const SkColor kBackgroundColor = SkColorSetRGB(230, 237, 244);
static const SkColor kBorderColor = SkColorSetRGB(201, 212, 225);
-static const SkColor kSeparatorHighlightColor = SkColorSetRGB(247, 250, 253);
+static const SkColor kDividerHighlightColor = SkColorSetRGB(247, 250, 253);
// TODO(erikkay) convert back to a gradient when Glen figures out the
// specs.
@@ -82,10 +85,10 @@ void ExtensionShelf::Paint(ChromeCanvas* canvas) {
int count = GetChildViewCount();
for (int i = 0; i < count; ++i) {
- int right = GetChildViewAt(i)->bounds().right();
+ int right = GetChildViewAt(i)->bounds().right() + kToolstripPadding;
int h = height() - 2;
canvas->FillRectInt(kBorderColor, right, 1, 1, h);
- canvas->FillRectInt(kSeparatorHighlightColor, right + 1, 1, 1, h);
+ canvas->FillRectInt(kDividerHighlightColor, right + 1, 1, 1, h);
}
SkRect background_rect = {
@@ -113,13 +116,14 @@ void ExtensionShelf::Layout() {
int count = GetChildViewCount();
for (int i = 0; i < count; ++i) {
+ x += kToolstripPadding; // left padding
views::View* child = GetChildViewAt(i);
gfx::Size pref = child->GetPreferredSize();
- int next_x = x + pref.width() + kToolstripPadding;
+ int next_x = x + pref.width() + kToolstripPadding; // right padding
child->SetVisible(next_x < max_x);
child->SetBounds(x, y, pref.width(), content_height);
child->Layout();
- x = next_x;
+ x = next_x + kToolstripDividerWidth;
}
}