summaryrefslogtreecommitdiff
path: root/src/gui/widgets/avatarlistbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/avatarlistbox.cpp')
-rw-r--r--src/gui/widgets/avatarlistbox.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 0d35ad188..d4764cba5 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -66,6 +66,9 @@ AvatarListBox::AvatarListBox(AvatarListModel *model):
config.addListener("showgender", this);
config.addListener("showlevel", this);
+
+ mHighlightColor = Theme::getThemeColor(Theme::HIGHLIGHT);
+ setForegroundColor(Theme::getThemeColor(Theme::TEXT));
}
AvatarListBox::~AvatarListBox()
@@ -102,8 +105,8 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
Graphics *graphics = static_cast<Graphics*>(gcnGraphics);
- graphics->setColor(Theme::getThemeColor(Theme::HIGHLIGHT,
- static_cast<int>(mAlpha * 255.0f)));
+ mHighlightColor.a = static_cast<int>(mAlpha * 255.0f);
+ graphics->setColor(mHighlightColor);
graphics->setFont(getFont());
const int fontHeight = getFont()->getHeight();
@@ -113,7 +116,7 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
const std::string name = player_node->getName();
// Draw the list elements
- graphics->setColor(Theme::getThemeColor(Theme::TEXT));
+ graphics->setColor(getForegroundColor());
for (int i = 0, y = 0;
i < model->getNumberOfElements();
++i, y += fontHeight)
@@ -206,7 +209,7 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
if (a->getLevel() > 1)
{
- graphics->setColor(Theme::getThemeColor(Theme::TEXT));
+ graphics->setColor(getForegroundColor());
int minHp = 40 + ((a->getLevel() - 1) * 5);
if (minHp < 0)
minHp = 40;
@@ -283,7 +286,7 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
}
}
- graphics->setColor(Theme::getThemeColor(Theme::TEXT));
+ graphics->setColor(getForegroundColor());
// Draw Name
if (a->getType() == MapItem::SEPARATOR)