Commit 03e4ef7f authored by msw@chromium.org's avatar msw@chromium.org

Match the NativeTextfieldViews cursor color to the text color.

The NativeTextfieldViews cursor color is hard-coded black.
Instead, set the cursor color to Textfield::GetTextColor.
This supports more Windows high-contrast black themes, etc.
However, if Windows has red text, they'll get red cursors.
(I think accessibility trumps that questionable coloring)
(also, the native behavior is worse in my ugly test theme)

BUG=252385,131660
TEST=Views Textfields cursors match their overall text color; meets accessibility requirements without other seriously negative effects.
R=oshima@chromium.org

Review URL: https://chromiumcodereview.appspot.com/17517005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207795 0039d316-1c4b-4281-b951-d872f2087c98
parent 74257bc5
......@@ -54,9 +54,6 @@
namespace {
// Default "system" color for text cursor.
const SkColor kDefaultCursorColor = SK_ColorBLACK;
void ConvertRectToScreen(const views::View* src, gfx::Rect* r) {
DCHECK(src);
......@@ -1118,7 +1115,7 @@ void NativeTextfieldViews::UpdateColorsFromTheme(const ui::NativeTheme* theme) {
UpdateTextColor();
UpdateBackgroundColor();
gfx::RenderText* render_text = GetRenderText();
render_text->set_cursor_color(kDefaultCursorColor);
render_text->set_cursor_color(textfield_->GetTextColor());
render_text->set_selection_color(theme->GetSystemColor(
ui::NativeTheme::kColorId_TextfieldSelectionColor));
render_text->set_selection_background_focused_color(theme->GetSystemColor(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment