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.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp
index 610b4360c..249254cde 100644
--- a/src/gui/widgets/extendedlistbox.cpp
+++ b/src/gui/widgets/extendedlistbox.cpp
@@ -61,7 +61,7 @@ void ExtendedListBox::draw(gcn::Graphics *graphics)
graphics->setFont(getFont());
const int height = getRowHeight();
- int textPos = (height - getFont()->getHeight()) / 2;
+ int textPos = (height - getFont()->getHeight()) / 2 + mPadding;
if (textPos < 0)
textPos = 0;
@@ -70,8 +70,9 @@ void ExtendedListBox::draw(gcn::Graphics *graphics)
{
mHighlightColor.a = static_cast<int>(mAlpha * 255.0f);
graphics->setColor(mHighlightColor);
- graphics->fillRectangle(gcn::Rectangle(0, height * mSelected,
- getWidth(), height));
+ graphics->fillRectangle(gcn::Rectangle(mPadding,
+ height * mSelected + mPadding,
+ getWidth() - 2 * mPadding, height));
}
// Draw the list elements
@@ -82,13 +83,14 @@ void ExtendedListBox::draw(gcn::Graphics *graphics)
const Image *const image = model->getImageAt(i);
if (!image)
{
- graphics->drawText(mListModel->getElementAt(i), 1, y + textPos);
+ graphics->drawText(mListModel->getElementAt(i), mPadding, y + textPos);
}
else
{
- g->drawImage(image, 1, y + (height - image->getHeight()) / 2);
+ g->drawImage(image, mPadding, y + (height - image->getHeight())
+ / 2 + mPadding);
graphics->drawText(mListModel->getElementAt(i),
- image->getWidth() + 2, y + textPos);
+ image->getWidth() + mPadding, y + textPos);
}
}
}