diff options
author | Oz Linden <oz@lindenlab.com> | 2011-08-31 09:06:19 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-08-31 09:06:19 -0400 |
commit | af3f8f98f6b6a18ae914ec1a92e6557f55506abf (patch) | |
tree | 337b3a46253f46fcfc47685bd5b4a548c847cd4f | |
parent | ee4fc00a2721ac402c278ed166fcb14661f4c720 (diff) | |
parent | a0f3b2a9cc0022605b4da6705bc3dc9578977f48 (diff) |
merge changes for storm-1566
-rw-r--r-- | indra/newview/llsidetray.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 651897a217..a7c4057846 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -496,7 +496,7 @@ public: LLSideTray* side_tray = LLSideTray::getInstance(); // Check if the tab we are dragging is docked. - if (!side_tray->isTabAttached(getName())) return FALSE; + if (!side_tray->isTabAttached(mTabName)) return FALSE; // Same value is hardcoded in LLDragHandle::handleHover(). const S32 undock_threshold = 12; @@ -505,7 +505,7 @@ public: if (delta_x <= -undock_threshold || delta_x >= undock_threshold || delta_y <= -undock_threshold || delta_y >= undock_threshold) { - LLSideTrayTab* tab = side_tray->getTab(getName()); + LLSideTrayTab* tab = side_tray->getTab(mTabName); if (!tab) return FALSE; tab->setDocked(false); @@ -544,7 +544,12 @@ protected: , mDragLastScreenX(0) , mDragLastScreenY(0) , mBadgeDriver(NULL) - {} + { + // Find out the tab name to use in handleHover(). + size_t pos = getName().find("_button"); + llassert(pos != std::string::npos); + mTabName = getName().substr(0, pos); + } friend class LLUICtrlFactory; @@ -562,6 +567,7 @@ private: S32 mDragLastScreenX; S32 mDragLastScreenY; + std::string mTabName; LLSideTrayTabBadgeDriver* mBadgeDriver; }; @@ -679,6 +685,7 @@ LLSideTrayTab* LLSideTray::getTab(const std::string& name) bool LLSideTray::isTabAttached(const std::string& name) { LLSideTrayTab* tab = getTab(name); + llassert(tab); if (!tab) return false; return std::find(mTabs.begin(), mTabs.end(), tab) != mTabs.end(); |