From 612c3e995f4fa39c3800795d9f1d34a2e32f97a8 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 13 Oct 2016 01:42:50 +0200 Subject: [PATCH] Add drop shadow to ItemWidget (Fixes #3545) --- apps/openmw/mwgui/itemwidget.cpp | 6 ++++++ apps/openmw/mwgui/itemwidget.hpp | 1 + files/mygui/openmw_resources.xml | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/apps/openmw/mwgui/itemwidget.cpp b/apps/openmw/mwgui/itemwidget.cpp index fa8383ace..87fca941e 100644 --- a/apps/openmw/mwgui/itemwidget.cpp +++ b/apps/openmw/mwgui/itemwidget.cpp @@ -28,6 +28,7 @@ namespace MWGui ItemWidget::ItemWidget() : mItem(NULL) + , mItemShadow(NULL) , mFrame(NULL) , mText(NULL) { @@ -44,6 +45,9 @@ namespace MWGui assignWidget(mItem, "Item"); if (mItem) mItem->setNeedMouseFocus(false); + assignWidget(mItemShadow, "ItemShadow"); + if (mItemShadow) + mItemShadow->setNeedMouseFocus(false); assignWidget(mFrame, "Frame"); if (mFrame) mFrame->setNeedMouseFocus(false); @@ -63,6 +67,8 @@ namespace MWGui void ItemWidget::setIcon(const std::string &icon) { + if (mItemShadow) + mItemShadow->setImageTexture(icon); if (mItem) mItem->setImageTexture(icon); } diff --git a/apps/openmw/mwgui/itemwidget.hpp b/apps/openmw/mwgui/itemwidget.hpp index e7a902239..ce9f58f50 100644 --- a/apps/openmw/mwgui/itemwidget.hpp +++ b/apps/openmw/mwgui/itemwidget.hpp @@ -44,6 +44,7 @@ namespace MWGui virtual void initialiseOverride(); MyGUI::ImageBox* mItem; + MyGUI::ImageBox* mItemShadow; MyGUI::ImageBox* mFrame; MyGUI::TextBox* mText; }; diff --git a/files/mygui/openmw_resources.xml b/files/mygui/openmw_resources.xml index ab6899341..d6a4f1b45 100644 --- a/files/mygui/openmw_resources.xml +++ b/files/mygui/openmw_resources.xml @@ -120,6 +120,10 @@ + + + +