summaryrefslogtreecommitdiff
path: root/src/gui/widgets/avatarlistbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-27 16:48:32 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-27 23:15:05 +0300
commitcdc721a1c6c5cf80736101352161b66ea3f90c50 (patch)
treec32e7e25fe1ad6f23efd2dc50c4eeb5431967249 /src/gui/widgets/avatarlistbox.cpp
parentcc78907ee5b2ed84760534897f88f8c1fcce957d (diff)
downloadplus-cdc721a1c6c5cf80736101352161b66ea3f90c50.tar.gz
plus-cdc721a1c6c5cf80736101352161b66ea3f90c50.tar.bz2
plus-cdc721a1c6c5cf80736101352161b66ea3f90c50.tar.xz
plus-cdc721a1c6c5cf80736101352161b66ea3f90c50.zip
Remove set font from graphics object.
Diffstat (limited to 'src/gui/widgets/avatarlistbox.cpp')
-rw-r--r--src/gui/widgets/avatarlistbox.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index d9fe65dfe..a8052fd8d 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -106,7 +106,6 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
mHighlightColor.a = static_cast<int>(mAlpha * 255.0f);
gcn::Font *const font = getFont();
- graphics->setFont(font);
const int fontHeight = getFont()->getHeight();
const gcn::Widget *const parent = mParent;
@@ -131,9 +130,6 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
graphics->drawImage(icon, mPadding, y + mPadding);
}
- if (a->getDisplayBold())
- graphics->setFont(boldFont);
-
std::string text;
if (a->getMaxHp() > 0)
@@ -268,13 +264,25 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
graphics->setColor(mForegroundColor);
// Draw Name
- if (a->getType() == MapItem::SEPARATOR)
- font->drawString(graphics, text, mPadding, y + mPadding);
- else
- font->drawString(graphics, text, 15 + mPadding, y + mPadding);
-
if (a->getDisplayBold())
- graphics->setFont(getFont());
+ {
+ if (a->getType() == MapItem::SEPARATOR)
+ {
+ boldFont->drawString(graphics, text, mPadding, y + mPadding);
+ }
+ else
+ {
+ boldFont->drawString(graphics, text,
+ 15 + mPadding, y + mPadding);
+ }
+ }
+ else
+ {
+ if (a->getType() == MapItem::SEPARATOR)
+ font->drawString(graphics, text, mPadding, y + mPadding);
+ else
+ font->drawString(graphics, text, 15 + mPadding, y + mPadding);
+ }
}
setWidth(parent->getWidth() - 10);