Skip to content
Snippets Groups Projects
Commit af3f8f98 authored by Oz Linden's avatar Oz Linden
Browse files

merge changes for storm-1566

parents ee4fc00a a0f3b2a9
No related branches found
No related tags found
No related merge requests found
...@@ -496,7 +496,7 @@ class LLSideTrayButton : public LLButton ...@@ -496,7 +496,7 @@ class LLSideTrayButton : public LLButton
LLSideTray* side_tray = LLSideTray::getInstance(); LLSideTray* side_tray = LLSideTray::getInstance();
// Check if the tab we are dragging is docked. // 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(). // Same value is hardcoded in LLDragHandle::handleHover().
const S32 undock_threshold = 12; const S32 undock_threshold = 12;
...@@ -505,7 +505,7 @@ class LLSideTrayButton : public LLButton ...@@ -505,7 +505,7 @@ class LLSideTrayButton : public LLButton
if (delta_x <= -undock_threshold || delta_x >= undock_threshold || if (delta_x <= -undock_threshold || delta_x >= undock_threshold ||
delta_y <= -undock_threshold || delta_y >= 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; if (!tab) return FALSE;
tab->setDocked(false); tab->setDocked(false);
...@@ -544,7 +544,12 @@ class LLSideTrayButton : public LLButton ...@@ -544,7 +544,12 @@ class LLSideTrayButton : public LLButton
, mDragLastScreenX(0) , mDragLastScreenX(0)
, mDragLastScreenY(0) , mDragLastScreenY(0)
, mBadgeDriver(NULL) , 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; friend class LLUICtrlFactory;
...@@ -562,6 +567,7 @@ class LLSideTrayButton : public LLButton ...@@ -562,6 +567,7 @@ class LLSideTrayButton : public LLButton
S32 mDragLastScreenX; S32 mDragLastScreenX;
S32 mDragLastScreenY; S32 mDragLastScreenY;
std::string mTabName;
LLSideTrayTabBadgeDriver* mBadgeDriver; LLSideTrayTabBadgeDriver* mBadgeDriver;
}; };
...@@ -679,6 +685,7 @@ LLSideTrayTab* LLSideTray::getTab(const std::string& name) ...@@ -679,6 +685,7 @@ LLSideTrayTab* LLSideTray::getTab(const std::string& name)
bool LLSideTray::isTabAttached(const std::string& name) bool LLSideTray::isTabAttached(const std::string& name)
{ {
LLSideTrayTab* tab = getTab(name); LLSideTrayTab* tab = getTab(name);
llassert(tab);
if (!tab) return false; if (!tab) return false;
return std::find(mTabs.begin(), mTabs.end(), tab) != mTabs.end(); return std::find(mTabs.begin(), mTabs.end(), tab) != mTabs.end();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment