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

Unified Diff: ui/views/controls/focusable_border.cc

Issue 516943003: Add textfield internal padding from FocusableBorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Shrink FocusableBorder; add Textfield and Combobox padding. Created 6 years, 4 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
Index: ui/views/controls/focusable_border.cc
diff --git a/ui/views/controls/focusable_border.cc b/ui/views/controls/focusable_border.cc
index 9789ed50767b0b3a925cc633f008b0690e62b089..631b0a681a037734a66065ef48ae51cb447f5ca7 100644
--- a/ui/views/controls/focusable_border.cc
+++ b/ui/views/controls/focusable_border.cc
@@ -11,23 +11,21 @@
namespace {
-// Define the size of the insets
-const int kTopInsetSize = 4;
-const int kLeftInsetSize = 4;
-const int kBottomInsetSize = 4;
-const int kRightInsetSize = 4;
+const int kInsetSize = 1;
} // namespace
namespace views {
FocusableBorder::FocusableBorder()
- : insets_(kTopInsetSize, kLeftInsetSize,
- kBottomInsetSize, kRightInsetSize),
+ : insets_(kInsetSize, kInsetSize, kInsetSize, kInsetSize),
override_color_(SK_ColorWHITE),
use_default_color_(true) {
}
+FocusableBorder::~FocusableBorder() {
+}
+
void FocusableBorder::SetColor(SkColor color) {
override_color_ = color;
use_default_color_ = false;
@@ -50,7 +48,7 @@ void FocusableBorder::Paint(const View& view, gfx::Canvas* canvas) {
}
paint.setColor(color);
- paint.setStrokeWidth(SkIntToScalar(2));
+ paint.setStrokeWidth(SkIntToScalar(2 * kInsetSize));
Peter Kasting 2014/08/29 21:09:11 This probably deserves a comment on why the stroke
msw 2014/08/30 00:17:48 I reverted this; it's just drawing a rect at the l
Peter Kasting 2014/08/30 00:46:42 Maybe then we should just draw a kInsetSize-px lin
msw 2014/09/04 01:25:51 Feel free to rewrite this separately.
canvas->DrawPath(path, paint);
}

Powered by Google App Engine
This is Rietveld 408576698