views: Update textfield colors when enabled state changes

This commit is contained in:
Marshall Greenblatt 2024-03-26 17:48:23 -04:00
parent 19ba8b2b8d
commit 8ba22e9e11
2 changed files with 20 additions and 0 deletions

View File

@ -733,4 +733,9 @@ patches = [
# https://chromium-review.googlesource.com/c/chromium/src/+/5388128
'name': 'chrome_watermark_5388128'
},
{
# views: Update textfield colors when enabled state changes
# https://chromium-review.googlesource.com/c/chromium/src/+/5399416
'name': 'views_textfield_5399416'
}
]

View File

@ -0,0 +1,15 @@
diff --git ui/views/controls/textfield/textfield.cc ui/views/controls/textfield/textfield.cc
index 8d1968f8c3f0d..e8fdc37c0aeb0 100644
--- ui/views/controls/textfield/textfield.cc
+++ ui/views/controls/textfield/textfield.cc
@@ -2972,6 +2972,10 @@ void Textfield::OnCursorBlinkTimerFired() {
void Textfield::OnEnabledChanged() {
if (GetInputMethod())
GetInputMethod()->OnTextInputTypeChanged(this);
+ if (GetWidget()) {
+ SetColor(GetTextColor());
+ UpdateBackgroundColor();
+ }
UpdateDefaultBorder();
}