diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-12-29 13:23:02 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-12-29 13:23:02 -0500 |
commit | 5f99331f4a9ed5ed78af7b47bdad152949e63ec4 (patch) | |
tree | 78aa91b7a1ac5f31a4e1de11f1a30d4b53561a05 /indra/newview/llsidetray.cpp | |
parent | ed365b9c0eea12fa30629be7d26605b77eeedc05 (diff) | |
parent | 087c105317058dc3a011c937a5aceaf87fdecc26 (diff) |
Automated merge up from viewer-development
Diffstat (limited to 'indra/newview/llsidetray.cpp')
-rw-r--r-- | indra/newview/llsidetray.cpp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 3bc3959e0b..aef665a35c 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -561,7 +561,7 @@ BOOL LLSideTray::postBuild() { if ((*it).channel) { - getCollapseSignal().connect(boost::bind(&LLScreenChannelBase::resetPositionAndSize, (*it).channel, _2)); + setVisibleWidthChangeCallback(boost::bind(&LLScreenChannelBase::resetPositionAndSize, (*it).channel)); } } @@ -980,9 +980,6 @@ void LLSideTray::reflectCollapseChange() } gFloaterView->refresh(); - - LLSD new_value = mCollapsed; - mCollapseSignal(this,new_value); } void LLSideTray::arrange() @@ -1262,9 +1259,29 @@ bool LLSideTray::isPanelActive(const std::string& panel_name) void LLSideTray::updateSidetrayVisibility() { // set visibility of parent container based on collapsed state - if (getParent()) + LLView* parent = getParent(); + if (parent) { - getParent()->setVisible(!mCollapsed && !gAgentCamera.cameraMouselook()); + bool old_visibility = parent->getVisible(); + bool new_visibility = !mCollapsed && !gAgentCamera.cameraMouselook(); + + if (old_visibility != new_visibility) + { + parent->setVisible(new_visibility); + + // Signal change of visible width. + llinfos << "Visible: " << new_visibility << llendl; + mVisibleWidthChangeSignal(this, new_visibility); + } } } +S32 LLSideTray::getVisibleWidth() +{ + return (isInVisibleChain() && !mCollapsed) ? getRect().getWidth() : 0; +} + +void LLSideTray::setVisibleWidthChangeCallback(const commit_signal_t::slot_type& cb) +{ + mVisibleWidthChangeSignal.connect(cb); +} |