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

Unified Diff: ui/views/controls/button/chrome_style.cc

Issue 11077006: Correct padding and focus ring for frameless constrained window dialog (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix license header Created 8 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/chrome_browser_ui.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/chrome_style.cc
diff --git a/ui/views/controls/button/chrome_style.cc b/ui/views/controls/button/chrome_style.cc
index 6122d3b83c6404ab21ec9b2d0e6701473cb5c1c6..4ffafe2f6217d2fc247cdfacbf3082dae95a873c 100644
--- a/ui/views/controls/button/chrome_style.cc
+++ b/ui/views/controls/button/chrome_style.cc
@@ -62,9 +62,9 @@ const SkColor kBorderNormalColor = SkColorSetARGB(0x3f, 0x0, 0x0, 0x0);
const SkColor kBorderActiveColor = SkColorSetARGB(0x4b, 0x0, 0x0, 0x0);
const SkColor kBorderDisabledColor = SkColorSetARGB(0x1d, 0x0, 0x0, 0x0);
-const int kFocusRingWidth = 2;
+const int kFocusRingWidth = 1;
const int kFocusRingRadius = 2;
-const SkColor kFocusRingColor = SkColorSetARGB(0x7f, 0xe5, 0x97, 0x00);
+const SkColor kFocusRingColor = SkColorSetRGB(0x4d, 0x90, 0xfe);
// Returns the uniform inset of the button from its local bounds.
int GetButtonInset() {
@@ -262,14 +262,20 @@ class ChromeStyleFocusBorder : public views::FocusBorder {
// Overriden from Border
virtual void Paint(const View& view, gfx::Canvas* canvas) const {
- gfx::Rect rect(view.GetLocalBounds());
- SkScalar inset = SkFloatToScalar(GetButtonInset() - kFocusRingWidth / 2.0f);
- rect.Inset(inset, inset);
SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style);
paint.setStrokeWidth(SkIntToScalar(kFocusRingWidth));
paint.setColor(kFocusRingColor);
- canvas->DrawRoundRect(rect, SkIntToScalar(kFocusRingRadius), paint);
+
+ SkScalar inset = SkFloatToScalar(GetButtonInset() - kFocusRingWidth / 2.0f);
+ gfx::Rect view_bounds(view.GetLocalBounds());
+ SkRect rect = SkRect::MakeLTRB(
+ SkIntToScalar(view_bounds.x()) + inset,
+ SkIntToScalar(view_bounds.y()) + inset,
+ SkIntToScalar(view_bounds.width()) - inset,
+ SkIntToScalar(view_bounds.height()) - inset);
+ canvas->sk_canvas()->drawRoundRect(rect, SkIntToScalar(kFocusRingRadius),
+ SkIntToScalar(kFocusRingRadius), paint);
}
private:
« no previous file with comments | « chrome/chrome_browser_ui.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698