diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-08-22 18:04:27 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-08-22 18:04:27 +0300 |
commit | a0f3b2a9cc0022605b4da6705bc3dc9578977f48 (patch) | |
tree | 88049442b5f2b1e56349b1baade2b5e1aaa0406a /indra/newview/llsidetray.cpp | |
parent | f73db20e0d007fd3405cd8b88242e724ba80ab50 (diff) |
STORM-1566 FIXED Sidebar tabs didn't detach by drag-n-drop.
The regression was introduced in the fix of EXP-856 (changeset 9e650f2750b5).
Diffstat (limited to 'indra/newview/llsidetray.cpp')
-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(); |