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

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

Issue 1931013002: MD-ify textfields and combobox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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 | « ui/native_theme/common_theme.cc ('k') | no next file » | no next file with comments »
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 b3ddd149272d50ed0c9ea954b6797708d2d54d6e..a4e76ff1ba2c88e4bd63a56b4f41f9f2cbc9ad3f 100644
--- a/ui/views/controls/focusable_border.cc
+++ b/ui/views/controls/focusable_border.cc
@@ -6,10 +6,13 @@
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkPath.h"
+#include "ui/base/material_design/material_design_controller.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/color_palette.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/skia_util.h"
#include "ui/native_theme/native_theme.h"
+#include "ui/views/controls/textfield/textfield.h"
namespace {
@@ -21,7 +24,7 @@ namespace views {
FocusableBorder::FocusableBorder()
: insets_(kInsetSize, kInsetSize, kInsetSize, kInsetSize),
- override_color_(SK_ColorWHITE),
+ override_color_(gfx::kPlaceholderColor),
use_default_color_(true) {
}
@@ -38,14 +41,21 @@ void FocusableBorder::UseDefaultColor() {
}
void FocusableBorder::Paint(const View& view, gfx::Canvas* canvas) {
- SkPath path;
- path.addRect(gfx::RectToSkRect(view.GetLocalBounds()), SkPath::kCW_Direction);
SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style);
-
paint.setColor(GetCurrentColor(view));
- paint.setStrokeWidth(SkIntToScalar(2));
+ SkPath path;
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
+ path.moveTo(Textfield::kTextPadding, view.height() - 1);
+ path.rLineTo(view.width() - Textfield::kTextPadding * 2, 0);
+ path.offset(0.5f, 0.5f);
+ paint.setStrokeWidth(SkIntToScalar(1));
+ } else {
+ path.addRect(gfx::RectToSkRect(view.GetLocalBounds()),
+ SkPath::kCW_Direction);
+ paint.setStrokeWidth(SkIntToScalar(2));
+ }
canvas->DrawPath(path, paint);
}
« no previous file with comments | « ui/native_theme/common_theme.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698