SetEnabled() didn't set the text view's colors correctly anymore; _UpdateTextViewColors()

asked for IsEnabled() before it was set.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16355 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-02-12 01:23:30 +00:00
parent 4d5192896a
commit 79c35b3912
2 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ class BTextControl : public BControl {
BTextControl& operator=(const BTextControl& other); BTextControl& operator=(const BTextControl& other);
void _CommitValue(); void _CommitValue();
void _UpdateTextViewColors(); void _UpdateTextViewColors(bool enabled);
void _InitData(const char* label, const char* initialText, void _InitData(const char* label, const char* initialText,
BMessage* archive = NULL); BMessage* archive = NULL);
+7 -8
View File
@@ -324,7 +324,7 @@ BTextControl::AttachedToWindow()
{ {
BControl::AttachedToWindow(); BControl::AttachedToWindow();
_UpdateTextViewColors(); _UpdateTextViewColors(IsEnabled());
fText->MakeEditable(IsEnabled()); fText->MakeEditable(IsEnabled());
} }
@@ -342,21 +342,21 @@ BTextControl::MakeFocus(bool state)
void void
BTextControl::SetEnabled(bool state) BTextControl::SetEnabled(bool enabled)
{ {
if (IsEnabled() == state) if (IsEnabled() == enabled)
return; return;
if (Window()) { if (Window()) {
fText->MakeEditable(state); fText->MakeEditable(enabled);
_UpdateTextViewColors(); _UpdateTextViewColors(enabled);
fText->Invalidate(); fText->Invalidate();
Window()->UpdateIfNeeded(); Window()->UpdateIfNeeded();
} }
BControl::SetEnabled(state); BControl::SetEnabled(enabled);
} }
@@ -578,9 +578,8 @@ BTextControl::operator=(const BTextControl&)
void void
BTextControl::_UpdateTextViewColors() BTextControl::_UpdateTextViewColors(bool enabled)
{ {
bool enabled = IsEnabled();
rgb_color textColor; rgb_color textColor;
rgb_color color = {0, 0, 0, 255}; rgb_color color = {0, 0, 0, 255};
BFont font; BFont font;