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

Unified Diff: ui/gfx/render_text.cc

Issue 12238002: Views Textfield: Copy on Ctrl+Insert, fix and disable overtype. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Expand unit tests. Created 7 years, 10 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/native_textfield_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.cc
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index 8f02724367a08b96a2b1180bb54038d1d1229b35..03a84fdfc7a1cb8c099d177a3d5d177374d10ae6 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -770,12 +770,6 @@ void RenderText::ApplyCompositionAndSelectionStyles() {
const ui::Range range(selection().GetMin(), selection().GetMax());
colors_.ApplyValue(selection_color_, range);
}
- // Apply the selected text color to the cursor range in overtype mode.
- if (!insert_mode_ && cursor_visible() && focused()) {
- const size_t cursor = cursor_position();
- const size_t next = IndexOfAdjacentGrapheme(cursor, CURSOR_FORWARD);
- colors_.ApplyValue(selection_color_, ui::Range(cursor, next));
- }
composition_and_selection_styles_applied_ = true;
}
@@ -962,9 +956,8 @@ void RenderText::DrawCursor(Canvas* canvas) {
// Paint cursor. Replace cursor is drawn as rectangle for now.
// TODO(msw): Draw a better cursor with a better indication of association.
if (cursor_enabled() && cursor_visible() && focused()) {
- const Rect& bounds = GetUpdatedCursorBounds();
- DCHECK(bounds.width());
- canvas->FillRect(bounds, cursor_color_);
+ canvas->FillRect(GetUpdatedCursorBounds(),
+ insert_mode_ ? cursor_color_ : selection_background_unfocused_color_);
}
}
« no previous file with comments | « no previous file | ui/views/controls/textfield/native_textfield_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698