summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2009-10-30 21:34:52 -0600
committerXiaohong Bao <bao@lindenlab.com>2009-10-30 21:34:52 -0600
commit4e1cde2e39cec8bca60faa65045a2055dd41efbf (patch)
tree1eb86813fdc2c90646254ac670f70e5ddd019b34 /indra/llui
parenta857fe1d82c82dfbebbcf1102f0f5ad06a396d60 (diff)
parent01d06db0154e0cfc43c82664c6bf6129a3fa4883 (diff)
merge
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lliconctrl.cpp17
-rw-r--r--indra/llui/lliconctrl.h8
2 files changed, 24 insertions, 1 deletions
diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp
index 66c2ba682f..82ffac9580 100644
--- a/indra/llui/lliconctrl.cpp
+++ b/indra/llui/lliconctrl.cpp
@@ -57,7 +57,9 @@ LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p)
: LLUICtrl(p),
mColor(p.color()),
mImagep(p.image),
- mPriority(0)
+ mPriority(0),
+ mDrawWidth(0),
+ mDrawHeight(0)
{
if (mImagep.notNull())
{
@@ -100,6 +102,8 @@ void LLIconCtrl::setValue(const LLSD& value )
{
mImagep = LLUI::getUIImage(tvalue.asString(), mPriority);
}
+
+ setIconImageDrawSize();
}
std::string LLIconCtrl::getImageName() const
@@ -109,3 +113,14 @@ std::string LLIconCtrl::getImageName() const
else
return std::string();
}
+
+void LLIconCtrl::setIconImageDrawSize()
+{
+ if(mImagep.notNull() && mDrawWidth && mDrawHeight)
+ {
+ if(mImagep->getImage().notNull())
+ {
+ mImagep->getImage()->setKnownDrawSize(mDrawWidth, mDrawHeight) ;
+ }
+ }
+} \ No newline at end of file
diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h
index 90f1693060..66368f979b 100644
--- a/indra/llui/lliconctrl.h
+++ b/indra/llui/lliconctrl.h
@@ -60,6 +60,7 @@ public:
protected:
LLIconCtrl(const Params&);
friend class LLUICtrlFactory;
+
public:
virtual ~LLIconCtrl();
@@ -73,9 +74,16 @@ public:
void setColor(const LLColor4& color) { mColor = color; }
+private:
+ void setIconImageDrawSize() ;
+
protected:
S32 mPriority;
+ //the output size of the icon image if set.
+ S32 mDrawWidth ;
+ S32 mDrawHeight ;
+
private:
LLUIColor mColor;
LLPointer<LLUIImage> mImagep;