summaryrefslogtreecommitdiff
path: root/src/gui/widgets/extendedlistbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-18 12:38:47 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-18 12:38:47 +0300
commit9f89a15fbcaf3f24f4c941b7061979e424d6384a (patch)
tree20d4fcec6e56b2bc35c095918ecb0b1d7dcf9a18 /src/gui/widgets/extendedlistbox.cpp
parentf5c13fca3863b2871ac20f9937bce4eb45c4a94c (diff)
downloadmanaverse-9f89a15fbcaf3f24f4c941b7061979e424d6384a.tar.gz
manaverse-9f89a15fbcaf3f24f4c941b7061979e424d6384a.tar.bz2
manaverse-9f89a15fbcaf3f24f4c941b7061979e424d6384a.tar.xz
manaverse-9f89a15fbcaf3f24f4c941b7061979e424d6384a.zip
Extend theming listbox with image.
New theme options: imagePadding - padding for image from left spacing - space between image and text
Diffstat (limited to 'src/gui/widgets/extendedlistbox.cpp')
-rw-r--r--src/gui/widgets/extendedlistbox.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp
index 0acf66a65..eb1e93303 100644
--- a/src/gui/widgets/extendedlistbox.cpp
+++ b/src/gui/widgets/extendedlistbox.cpp
@@ -40,7 +40,9 @@
ExtendedListBox::ExtendedListBox(gcn::ListModel *const listModel):
ListBox(listModel),
- mRowHeight(13)
+ mRowHeight(13),
+ mImagePadding(mSkin ? mSkin->getOption("imagePadding") : 0),
+ mSpacing(mSkin ? mSkin->getOption("spacing") : 0)
{
}
@@ -88,10 +90,10 @@ void ExtendedListBox::draw(gcn::Graphics *graphics)
}
else
{
- g->drawImage(image, mPadding, y + (height - image->getHeight())
- / 2 + mPadding);
+ g->drawImage(image, mImagePadding, y + (height
+ - image->getHeight()) / 2 + mPadding);
graphics->drawText(mListModel->getElementAt(i),
- image->getWidth() + mPadding, y + textPos);
+ image->getWidth() + mImagePadding + mSpacing, y + textPos);
}
}
}