diff options
-rw-r--r-- | indra/llui/lliconctrl.cpp | 5 | ||||
-rw-r--r-- | indra/llui/lliconctrl.h | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/avatar_icon.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/icon.xml | 1 |
4 files changed, 13 insertions, 2 deletions
diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index 627957061d..47f2cfaf89 100644 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -41,6 +41,7 @@ static LLDefaultChildRegistry::Register<LLIconCtrl> r("icon"); LLIconCtrl::Params::Params() : image("image_name"), color("color"), + use_draw_context_alpha("use_draw_context_alpha", true), scale_image("scale_image") { tab_stop = false; @@ -51,6 +52,7 @@ LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p) : LLUICtrl(p), mColor(p.color()), mImagep(p.image), + mUseDrawContextAlpha(p.use_draw_context_alpha), mPriority(0), mDrawWidth(0), mDrawHeight(0) @@ -71,7 +73,8 @@ void LLIconCtrl::draw() { if( mImagep.notNull() ) { - mImagep->draw(getLocalRect(), mColor.get() % getDrawContext().mAlpha ); + const F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency(); + mImagep->draw(getLocalRect(), mColor.get() % alpha ); } LLUICtrl::draw(); diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index 79a8b0fb28..e9bdab2d47 100644 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -48,6 +48,7 @@ public: { Optional<LLUIImage*> image; Optional<LLUIColor> color; + Optional<bool> use_draw_context_alpha; Ignored scale_image; Params(); }; @@ -79,6 +80,10 @@ protected: S32 mDrawWidth ; S32 mDrawHeight ; + // If set to true (default), use the draw context transparency. + // If false, will use transparency returned by getCurrentTransparency(). See STORM-698. + bool mUseDrawContextAlpha; + private: LLUIColor mColor; LLPointer<LLUIImage> mImagep; diff --git a/indra/newview/skins/default/xui/en/widgets/avatar_icon.xml b/indra/newview/skins/default/xui/en/widgets/avatar_icon.xml index a35e2c3663..a1e32e44de 100644 --- a/indra/newview/skins/default/xui/en/widgets/avatar_icon.xml +++ b/indra/newview/skins/default/xui/en/widgets/avatar_icon.xml @@ -1,4 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<avatar_icon default_icon_name="Generic_Person_Large"> +<avatar_icon + default_icon_name="Generic_Person_Large" + use_draw_context_alpha="false"> </avatar_icon> diff --git a/indra/newview/skins/default/xui/en/widgets/icon.xml b/indra/newview/skins/default/xui/en/widgets/icon.xml index adb743a628..cf8edfcedb 100644 --- a/indra/newview/skins/default/xui/en/widgets/icon.xml +++ b/indra/newview/skins/default/xui/en/widgets/icon.xml @@ -3,5 +3,6 @@ tab_stop="false" mouse_opaque="false" name="icon" + use_draw_context_alpha="true" follows="left|top"> </icon> |