summaryrefslogtreecommitdiff
path: root/src/gui/widgets/extendedlistbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/extendedlistbox.cpp')
-rw-r--r--src/gui/widgets/extendedlistbox.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp
index bad1472ac..af1480f86 100644
--- a/src/gui/widgets/extendedlistbox.cpp
+++ b/src/gui/widgets/extendedlistbox.cpp
@@ -60,7 +60,8 @@ void ExtendedListBox::draw(gcn::Graphics *graphics)
Graphics *const g = static_cast<Graphics *const>(graphics);
updateAlpha();
- graphics->setFont(getFont());
+ gcn::Font *const font = getFont();
+ graphics->setFont(font);
const int height = getRowHeight();
int textPos = (height - getFont()->getHeight()) / 2 + mPadding;
@@ -87,14 +88,14 @@ void ExtendedListBox::draw(gcn::Graphics *graphics)
const Image *const image = model->getImageAt(i);
if (!image)
{
- graphics->drawText(mListModel->getElementAt(i),
+ font->drawString(graphics, mListModel->getElementAt(i),
mPadding, y + textPos);
}
else
{
g->drawImage(image, mImagePadding, y + (height
- image->getHeight()) / 2 + mPadding);
- graphics->drawText(mListModel->getElementAt(i),
+ font->drawString(graphics, mListModel->getElementAt(i),
image->getWidth() + mImagePadding + mSpacing, y + textPos);
}
}
@@ -104,13 +105,13 @@ void ExtendedListBox::draw(gcn::Graphics *graphics)
const Image *const image = model->getImageAt(mSelected);
if (!image)
{
- graphics->drawText(mListModel->getElementAt(mSelected),
+ font->drawString(graphics, mListModel->getElementAt(mSelected),
mPadding, mSelected * height + textPos);
}
else
{
graphics->setColor(mForegroundSelectedColor);
- graphics->drawText(mListModel->getElementAt(mSelected),
+ font->drawString(graphics, mListModel->getElementAt(mSelected),
image->getWidth() + mImagePadding + mSpacing,
mSelected * height + textPos);
}