summaryrefslogtreecommitdiff
path: root/src/gui/widgets/shoplistbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-16 03:22:50 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-16 03:25:37 +0300
commit82cc576b7896f39bcf71aa85c8c4b3ef786c065b (patch)
tree2207f3bb4a0b1fa896fe183da245287525d65117 /src/gui/widgets/shoplistbox.cpp
parent6bbe09af6faa77df40112e7cf876877ef11ce74b (diff)
downloadplus-82cc576b7896f39bcf71aa85c8c4b3ef786c065b.tar.gz
plus-82cc576b7896f39bcf71aa85c8c4b3ef786c065b.tar.bz2
plus-82cc576b7896f39bcf71aa85c8c4b3ef786c065b.tar.xz
plus-82cc576b7896f39bcf71aa85c8c4b3ef786c065b.zip
Add listbox padding.
New theme file: listbox.xml Theme option: padding
Diffstat (limited to 'src/gui/widgets/shoplistbox.cpp')
-rw-r--r--src/gui/widgets/shoplistbox.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp
index 480f220ea..79fca30d5 100644
--- a/src/gui/widgets/shoplistbox.cpp
+++ b/src/gui/widgets/shoplistbox.cpp
@@ -95,7 +95,6 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics)
Graphics *graphics = static_cast<Graphics*>(gcnGraphics);
graphics->setFont(getFont());
-// graphics->setColor(mForegroundColor);
// Draw the list elements
for (int i = 0, y = 0;
@@ -139,8 +138,8 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics)
if (needDraw)
{
graphics->setColor(*backgroundColor);
- graphics->fillRectangle(gcn::Rectangle(
- 0, y, getWidth(), mRowHeight));
+ graphics->fillRectangle(gcn::Rectangle(mPadding, y + mPadding,
+ getWidth() - 2 * mPadding, mRowHeight));
}
if (mShopItems)
@@ -149,12 +148,13 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics)
if (icon)
{
icon->setAlpha(1.0f);
- graphics->drawImage(icon, 1, y);
+ graphics->drawImage(icon, mPadding, y + mPadding);
}
}
graphics->setColor(mForegroundColor);
- graphics->drawText(mListModel->getElementAt(i), ITEM_ICON_SIZE + 5,
- y + (ITEM_ICON_SIZE - getFont()->getHeight()) / 2);
+ graphics->drawText(mListModel->getElementAt(i),
+ ITEM_ICON_SIZE + mPadding,
+ y + (ITEM_ICON_SIZE - getFont()->getHeight()) / 2 + mPadding);
}
}