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

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

Issue 358553004: Added text filtering to Overview Mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index cb3e5423814432168664c60ec7a6ce84ce167ebc..6b945b3b2ebbd13d846221c1f99b0b60151bede7 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -268,6 +268,7 @@ Textfield::Textfield()
performing_user_action_(false),
skip_input_method_cancel_composition_(false),
cursor_visible_(false),
+ has_shadow_(false),
drop_cursor_visible_(false),
initiating_drag_(false),
aggregated_clicks_(0),
@@ -431,6 +432,11 @@ void Textfield::UseDefaultSelectionBackgroundColor() {
SchedulePaint();
}
+void Textfield::DisplayShadow(bool display_shadow) {
+ has_shadow_ = display_shadow;
+ SchedulePaint();
tdanderson 2014/06/25 15:48:23 It should be the responsibility of the caller to i
Nina 2014/06/26 15:20:18 Hmmm all the other setters call SchedulePaint(). I
+}
+
bool Textfield::GetCursorEnabled() const {
return GetRenderText()->cursor_enabled();
}
@@ -1588,6 +1594,14 @@ void Textfield::PaintTextAndCursor(gfx::Canvas* canvas) {
// Draw the text, cursor, and selection.
render_text->set_cursor_visible(cursor_visible_ && !drop_cursor_visible_ &&
!HasSelection());
+
+ if (has_shadow_) {
+ // Draw a basic shadow underneath the text.
+ gfx::ShadowValues shadows;
+ shadows.push_back(gfx::ShadowValue(gfx::Point(0, 1), 10, SK_ColorBLACK));
tdanderson 2014/06/25 15:48:23 I wonder if it's worthwhile defining constants for
Nina 2014/06/26 15:20:18 As we discussed off the patch, we might want to ch
+ render_text->set_shadows(shadows);
+ }
+
render_text->Draw(canvas);
// Draw the detached drop cursor that marks where the text will be dropped.
« ui/views/controls/textfield/textfield.h ('K') | « ui/views/controls/textfield/textfield.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698