summaryrefslogtreecommitdiff
path: root/src/gui/widgets/itemcontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-30 23:57:54 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-30 23:57:54 +0300
commit382d24526919eafc08df19169046fdae190e10da (patch)
tree5eee2825a6a0dd282990c1a6a2f4a8e924c8083d /src/gui/widgets/itemcontainer.cpp
parentbe1962973deaa161491b6592cbf21eb3e6700cc9 (diff)
downloadplus-382d24526919eafc08df19169046fdae190e10da.tar.gz
plus-382d24526919eafc08df19169046fdae190e10da.tar.bz2
plus-382d24526919eafc08df19169046fdae190e10da.tar.xz
plus-382d24526919eafc08df19169046fdae190e10da.zip
Add support for npc dialog inventory theming from npc skin.
Diffstat (limited to 'src/gui/widgets/itemcontainer.cpp')
-rw-r--r--src/gui/widgets/itemcontainer.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index ad9f868ad..59d5c8976 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -901,6 +901,11 @@ void ItemContainer::mouseExited(MouseEvent &event A_UNUSED)
void ItemContainer::widgetResized(const Event &event A_UNUSED)
{
+ updateSize();
+}
+
+void ItemContainer::updateSize()
+{
mGridColumns = std::min(mMaxColumns,
std::max(1, mDimension.width / mBoxWidth));
if (mGridColumns > mMaxColumns)
@@ -1088,3 +1093,9 @@ void ItemContainer::setCellBackgroundImage(const std::string &xmlName)
mCellBackgroundImg = Theme::getImageFromThemeXml(xmlName, "");
mRedraw = true;
}
+
+void ItemContainer::setMaxColumns(const int maxColumns)
+{
+ mMaxColumns = maxColumns;
+ updateSize();
+}