summaryrefslogtreecommitdiff
path: root/indra/newview/llsettingspicker.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-09-11 17:10:32 -0700
committerRider Linden <rider@lindenlab.com>2018-09-11 17:10:32 -0700
commit4fe44b9033ee793134b7c080c71931c62c33ddf9 (patch)
tree2ed96112e8d2f60e4cd7a57ee241156223e41de2 /indra/newview/llsettingspicker.cpp
parent3558377d540de31bdb615f9c0e0df8163b33ccf8 (diff)
SL-9626: When the panel loses visibility the picker is now automatically closed. Also picker checks handle to parent rather than pointer to parent.
Diffstat (limited to 'indra/newview/llsettingspicker.cpp')
-rw-r--r--indra/newview/llsettingspicker.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/newview/llsettingspicker.cpp b/indra/newview/llsettingspicker.cpp
index c882e7dbbb..06d54825e7 100644
--- a/indra/newview/llsettingspicker.cpp
+++ b/indra/newview/llsettingspicker.cpp
@@ -59,13 +59,15 @@ namespace
LLFloaterSettingsPicker::LLFloaterSettingsPicker(LLView * owner, LLUUID initial_asset_id, const std::string &label, const LLSD &params):
LLFloater(params),
- mOwner(owner),
+ mOwnerHandle(),
mLabel(label),
mActive(true),
mContextConeOpacity(0.0f),
mSettingAssetID(initial_asset_id),
mImmediateFilterPermMask(PERM_NONE)
{
+ mOwnerHandle = owner->getHandle();
+
buildFromFile(FLOATER_DEFINITION_XML);
setCanMinimize(FALSE);
}
@@ -136,9 +138,10 @@ void LLFloaterSettingsPicker::onClose(bool app_quitting)
return;
mCloseSignal();
- if (mOwner)
+ LLView *owner = mOwnerHandle.get();
+ if (owner)
{
- mOwner->setFocus(TRUE);
+ owner->setFocus(TRUE);
}
}
@@ -165,13 +168,14 @@ void LLFloaterSettingsPicker::setSettingsFilter(LLSettingsType::type_e type)
void LLFloaterSettingsPicker::draw()
{
- if (mOwner)
+ LLView *owner = mOwnerHandle.get();
+ if (owner)
{
// draw cone of context pointing back to texture swatch
LLRect owner_rect;
- mOwner->localRectToOtherView(mOwner->getLocalRect(), &owner_rect, this);
+ owner->localRectToOtherView(owner->getLocalRect(), &owner_rect, this);
LLRect local_rect = getLocalRect();
- if (gFocusMgr.childHasKeyboardFocus(this) && mOwner->isInVisibleChain() && mContextConeOpacity > 0.001f)
+ if (gFocusMgr.childHasKeyboardFocus(this) && owner->isInVisibleChain() && mContextConeOpacity > 0.001f)
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLGLEnable(GL_CULL_FACE);