summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/graphics/gui/itemcontainer.xml2
-rw-r--r--src/gui/widgets/itemcontainer.cpp5
-rw-r--r--src/gui/widgets/itemcontainer.h2
3 files changed, 8 insertions, 1 deletions
diff --git a/data/graphics/gui/itemcontainer.xml b/data/graphics/gui/itemcontainer.xml
index 1e320ddef..0971556cc 100644
--- a/data/graphics/gui/itemcontainer.xml
+++ b/data/graphics/gui/itemcontainer.xml
@@ -3,5 +3,7 @@
<option name="boxWidth" value="35" />
<option name="boxHeight" value="53" />
<option name="equippedTextPadding" value="29" />
+ <option name="paddingItemX" value="0" />
+ <option name="paddingItemY" value="0" />
</widget>
</skinset>
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index d5fc81686..616c5caa2 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -180,6 +180,8 @@ ItemContainer::ItemContainer(const Widget2 *const widget,
mBoxHeight(mSkin ? mSkin->getOption("boxHeight", 43) : 43),
mEquippedTextPadding(mSkin ? mSkin->getOption(
"equippedTextPadding", 29) : 29),
+ mPaddingItemX(mSkin ? mSkin->getOption("paddingItemX", 0) : 0),
+ mPaddingItemY(mSkin ? mSkin->getOption("paddingItemY", 0) : 0),
mEquipedColor(getThemeColor(Theme::ITEM_EQUIPPED)),
mUnEquipedColor(getThemeColor(Theme::ITEM_NOT_EQUIPPED))
{
@@ -266,7 +268,8 @@ void ItemContainer::draw(gcn::Graphics *graphics)
}
}
image->setAlpha(1.0f); // ensure the image if fully drawn...
- g->drawImage(image, itemX, itemY);
+ g->drawImage(image, itemX + mPaddingItemX,
+ itemY + mPaddingItemY);
}
}
}
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h
index cc5c21c64..fed91e5ca 100644
--- a/src/gui/widgets/itemcontainer.h
+++ b/src/gui/widgets/itemcontainer.h
@@ -215,6 +215,8 @@ class ItemContainer final : public gcn::Widget,
int mBoxWidth;
int mBoxHeight;
int mEquippedTextPadding;
+ int mPaddingItemX;
+ int mPaddingItemY;
typedef std::list<gcn::SelectionListener*> SelectionListenerList;
typedef SelectionListenerList::iterator SelectionListenerIterator;