summaryrefslogtreecommitdiffstats
path: root/views/controls/textfield/native_textfield_gtk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls/textfield/native_textfield_gtk.cc')
-rw-r--r--views/controls/textfield/native_textfield_gtk.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/views/controls/textfield/native_textfield_gtk.cc b/views/controls/textfield/native_textfield_gtk.cc
index ef7a67d..2a5aa15 100644
--- a/views/controls/textfield/native_textfield_gtk.cc
+++ b/views/controls/textfield/native_textfield_gtk.cc
@@ -84,6 +84,17 @@ void NativeTextfieldGtk::UpdateBorder() {
return;
}
+void NativeTextfieldGtk::UpdateTextColor() {
+ if (textfield_->use_default_text_color()) {
+ // Passing NULL as the color undoes the effect of previous calls to
+ // gtk_widget_modify_text.
+ gtk_widget_modify_text(native_view(), GTK_STATE_NORMAL, NULL);
+ return;
+ }
+ GdkColor gdk_color = skia::SkColorToGdkColor(textfield_->text_color());
+ gtk_widget_modify_text(native_view(), GTK_STATE_NORMAL, &gdk_color);
+}
+
void NativeTextfieldGtk::UpdateBackgroundColor() {
if (textfield_->use_default_background_color()) {
// Passing NULL as the color undoes the effect of previous calls to