diff --git a/headers/os/interface/TextControl.h b/headers/os/interface/TextControl.h index a0c5213ebb..c68f6699a9 100644 --- a/headers/os/interface/TextControl.h +++ b/headers/os/interface/TextControl.h @@ -81,7 +81,7 @@ class BTextControl : public BControl { BTextControl& operator=(const BTextControl& other); void _CommitValue(); - void _UpdateTextViewColors(); + void _UpdateTextViewColors(bool enabled); void _InitData(const char* label, const char* initialText, BMessage* archive = NULL); diff --git a/src/kits/interface/TextControl.cpp b/src/kits/interface/TextControl.cpp index fc6202f01d..242fb57069 100644 --- a/src/kits/interface/TextControl.cpp +++ b/src/kits/interface/TextControl.cpp @@ -324,7 +324,7 @@ BTextControl::AttachedToWindow() { BControl::AttachedToWindow(); - _UpdateTextViewColors(); + _UpdateTextViewColors(IsEnabled()); fText->MakeEditable(IsEnabled()); } @@ -342,21 +342,21 @@ BTextControl::MakeFocus(bool state) void -BTextControl::SetEnabled(bool state) +BTextControl::SetEnabled(bool enabled) { - if (IsEnabled() == state) + if (IsEnabled() == enabled) return; if (Window()) { - fText->MakeEditable(state); + fText->MakeEditable(enabled); - _UpdateTextViewColors(); + _UpdateTextViewColors(enabled); fText->Invalidate(); Window()->UpdateIfNeeded(); } - BControl::SetEnabled(state); + BControl::SetEnabled(enabled); } @@ -578,9 +578,8 @@ BTextControl::operator=(const BTextControl&) void -BTextControl::_UpdateTextViewColors() +BTextControl::_UpdateTextViewColors(bool enabled) { - bool enabled = IsEnabled(); rgb_color textColor; rgb_color color = {0, 0, 0, 255}; BFont font;