summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-01-18 17:02:19 +0300
committerAndrei Karas <akaras@inbox.ru>2013-01-18 17:02:19 +0300
commitf530e0f244ed2ad84db61d8e1069ffc72516d59b (patch)
tree33a253706ff0478ef867b41ac903c1e58049ef61
parentf5dda8fa79877575c9e656a06f8e8c40055110c8 (diff)
downloadmanaverse-f530e0f244ed2ad84db61d8e1069ffc72516d59b.tar.gz
manaverse-f530e0f244ed2ad84db61d8e1069ffc72516d59b.tar.bz2
manaverse-f530e0f244ed2ad84db61d8e1069ffc72516d59b.tar.xz
manaverse-f530e0f244ed2ad84db61d8e1069ffc72516d59b.zip
Add padding for items in extended listboxes.
New parameter: itemPadding - padding from up and down for each list entry.
-rw-r--r--data/graphics/gui/listbox.xml1
-rw-r--r--src/gui/widgets/extendedlistbox.cpp5
-rw-r--r--src/gui/widgets/extendedlistbox.h1
3 files changed, 5 insertions, 2 deletions
diff --git a/data/graphics/gui/listbox.xml b/data/graphics/gui/listbox.xml
index 6e7cf6080..5e1a5872d 100644
--- a/data/graphics/gui/listbox.xml
+++ b/data/graphics/gui/listbox.xml
@@ -4,5 +4,6 @@
<option name="imagePadding" value="1" />
<option name="textPadding" value="34" />
<option name="spacing" value="2" />
+ <option name="itemPadding" value="1" />
</widget>
</skinset>
diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp
index 5a81084c3..34f4f1a45 100644
--- a/src/gui/widgets/extendedlistbox.cpp
+++ b/src/gui/widgets/extendedlistbox.cpp
@@ -42,13 +42,14 @@ ExtendedListBox::ExtendedListBox(const Widget2 *const widget,
ListBox(widget, listModel),
mRowHeight(rowHeight),
mImagePadding(mSkin ? mSkin->getOption("imagePadding") : 0),
- mSpacing(mSkin ? mSkin->getOption("spacing") : 0)
+ mSpacing(mSkin ? mSkin->getOption("spacing") : 0),
+ mItemPadding(mSkin ? mSkin->getOption("itemPadding") : 1)
{
if (!mRowHeight)
{
const gcn::Font *font = getFont();
if (font)
- mRowHeight = font->getHeight() + 2 * mPadding;
+ mRowHeight = font->getHeight() + 2 * mItemPadding;
else
mRowHeight = 13;
}
diff --git a/src/gui/widgets/extendedlistbox.h b/src/gui/widgets/extendedlistbox.h
index 9d86b1780..9da77abe7 100644
--- a/src/gui/widgets/extendedlistbox.h
+++ b/src/gui/widgets/extendedlistbox.h
@@ -52,6 +52,7 @@ class ExtendedListBox final : public ListBox
unsigned int mRowHeight;
int mImagePadding;
int mSpacing;
+ int mItemPadding;
};
#endif