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

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: 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
« no previous file with comments | « no previous file | ui/views/controls/textfield/textfield.h » ('j') | ui/views/controls/textfield/textfield.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..94e24fe34ef39aad76d8e64ea54c1534cc2ef3ac 100644
--- a/ui/views/controls/focusable_border.cc
+++ b/ui/views/controls/focusable_border.cc
@@ -11,11 +11,12 @@
namespace {
-// Define the size of the insets
+// The size of the insets and the stroke.
const int kTopInsetSize = 4;
const int kLeftInsetSize = 4;
const int kBottomInsetSize = 4;
const int kRightInsetSize = 4;
+const int kStrokeWidth = 2;
} // namespace
@@ -50,7 +51,7 @@ void FocusableBorder::Paint(const View& view, gfx::Canvas* canvas) {
}
paint.setColor(color);
- paint.setStrokeWidth(SkIntToScalar(2));
+ paint.setStrokeWidth(SkIntToScalar(kStrokeWidth));
canvas->DrawPath(path, paint);
}
@@ -60,7 +61,7 @@ gfx::Insets FocusableBorder::GetInsets() const {
}
gfx::Size FocusableBorder::GetMinimumSize() const {
- return gfx::Size();
+ return gfx::Size(kStrokeWidth, kStrokeWidth);
}
void FocusableBorder::SetInsets(int top, int left, int bottom, int right) {
« no previous file with comments | « no previous file | ui/views/controls/textfield/textfield.h » ('j') | ui/views/controls/textfield/textfield.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698