summaryrefslogtreecommitdiff
path: root/src/gui/widgets/icon.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2010-05-05 00:36:41 +0300
committerBertram <yohanndotferreiraatorange.fr>2010-05-13 00:21:48 +0200
commitda50354af7fffe79ee7137a3f3dd9d8b9f34afda (patch)
treefc497b9a29dec5dacad514598665eced09d05baf /src/gui/widgets/icon.cpp
parent46cd4e737a5a74f823877c1fd00a6af84005612f (diff)
downloadmana-da50354af7fffe79ee7137a3f3dd9d8b9f34afda.tar.gz
mana-da50354af7fffe79ee7137a3f3dd9d8b9f34afda.tar.bz2
mana-da50354af7fffe79ee7137a3f3dd9d8b9f34afda.tar.xz
mana-da50354af7fffe79ee7137a3f3dd9d8b9f34afda.zip
Draw item image in item popups.
Now draw image only in chat item popup. Reviewed-by: Bertram
Diffstat (limited to 'src/gui/widgets/icon.cpp')
-rw-r--r--src/gui/widgets/icon.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/widgets/icon.cpp b/src/gui/widgets/icon.cpp
index ef22c37d..4e590212 100644
--- a/src/gui/widgets/icon.cpp
+++ b/src/gui/widgets/icon.cpp
@@ -30,20 +30,22 @@ Icon::Icon(const std::string &file)
: mImage(0)
{
mImage = ResourceManager::getInstance()->getImage(file);
- setSize(mImage->getWidth(), mImage->getHeight());
-
+ if (mImage)
+ setSize(mImage->getWidth(), mImage->getHeight());
}
Icon::Icon(Image *image)
: mImage(image)
{
- setSize(mImage->getWidth(), mImage->getHeight());
+ if (mImage)
+ setSize(mImage->getWidth(), mImage->getHeight());
}
void Icon::setImage(Image *image)
{
mImage = image;
- setSize(mImage->getWidth(), mImage->getHeight());
+ if (mImage)
+ setSize(mImage->getWidth(), mImage->getHeight());
}
void Icon::draw(gcn::Graphics *g)