From 382d24526919eafc08df19169046fdae190e10da Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 30 Oct 2015 23:57:54 +0300 Subject: Add support for npc dialog inventory theming from npc skin. --- src/gui/widgets/itemcontainer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gui/widgets/itemcontainer.cpp') 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 @@ -900,6 +900,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)); @@ -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(); +} -- cgit v1.2.3-70-g09d2