diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2023-10-13 14:02:51 -0700 |
---|---|---|
committer | Cosmic Linden <cosmic@lindenlab.com> | 2023-10-13 14:02:51 -0700 |
commit | a91f08ba84844647bbcdecac11e85c449579527c (patch) | |
tree | 9bfdc77c9e7de33413b95f2648cb139b19cb06f0 /indra/llui/lliconctrl.cpp | |
parent | cc0f831aaa960552b218da436da57b44cb2dfe0f (diff) | |
parent | cba71633559ccdfd394983a6086da816e739a730 (diff) |
Merge branch 'DRTVWR-559' into DRTVWR-592
Diffstat (limited to 'indra/llui/lliconctrl.cpp')
-rw-r--r-- | indra/llui/lliconctrl.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index e01aba402e..2791377a5e 100644 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -37,6 +37,8 @@ #include "lluiimage.h" #include "llwindow.h" +#include "llgltexture.h" + static LLDefaultChildRegistry::Register<LLIconCtrl> r("icon"); LLIconCtrl::Params::Params() @@ -94,6 +96,22 @@ BOOL LLIconCtrl::handleHover(S32 x, S32 y, MASK mask) return LLUICtrl::handleHover(x, y, mask); } +void LLIconCtrl::onVisibilityChange(BOOL new_visibility) +{ + LLUICtrl::onVisibilityChange(new_visibility); + if (mPriority == LLGLTexture::BOOST_ICON) + { + if (new_visibility) + { + loadImage(getValue(), mPriority); + } + else + { + mImagep = nullptr; + } + } +} + // virtual // value might be a string or a UUID void LLIconCtrl::setValue(const LLSD& value) @@ -110,6 +128,14 @@ void LLIconCtrl::setValue(const LLSD& value, S32 priority) tvalue = LLSD(LLUUID(value.asString())); } LLUICtrl::setValue(tvalue); + + loadImage(tvalue, priority); +} + +void LLIconCtrl::loadImage(const LLSD& tvalue, S32 priority) +{ + if(mPriority == LLGLTexture::BOOST_ICON && !getVisible()) return; + if (tvalue.isUUID()) { mImagep = LLUI::getUIImageByID(tvalue.asUUID(), priority); |