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
+7 -8
View File
@@ -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;