diff options
author | Oz Linden <oz@lindenlab.com> | 2011-01-21 15:14:39 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-01-21 15:14:39 -0500 |
commit | 4652e26196ed43e3a2fdd5bbb2e6c4b6b8466719 (patch) | |
tree | de6ce52d54764b0cf7d0c33d17d1cd7e71ffad1b /indra/newview/llsidetray.cpp | |
parent | 3571e83b6413e0c1050540a6cddeeaa7c6ca91c1 (diff) | |
parent | 2d6228b4e0454c7d82770748eb572258c402319c (diff) |
merge changes for storm-869
Diffstat (limited to 'indra/newview/llsidetray.cpp')
-rw-r--r-- | indra/newview/llsidetray.cpp | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 3bc3959e0b..19d1bdee86 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -498,8 +498,8 @@ private: LLSideTray::Params::Params() : collapsed("collapsed",false), - tab_btn_image_normal("tab_btn_image",LLUI::getUIImage("sidebar_tab_left.tga")), - tab_btn_image_selected("tab_btn_image_selected",LLUI::getUIImage("button_enabled_selected_32x128.tga")), + tab_btn_image_normal("tab_btn_image",LLUI::getUIImage("taskpanel/TaskPanel_Tab_Off.png")), + tab_btn_image_selected("tab_btn_image_selected",LLUI::getUIImage("taskpanel/TaskPanel_Tab_Selected.png")), default_button_width("tab_btn_width",32), default_button_height("tab_btn_height",32), default_button_margin("tab_btn_margin",0) @@ -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); +} |