summaryrefslogtreecommitdiff
path: root/indra/llui/lltoolbar.cpp
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2011-10-06 16:48:19 -0700
committerRichard Nelson <richard@lindenlab.com>2011-10-06 16:48:19 -0700
commit740b3547d6b4685bcd89bb2781ccb423ab935799 (patch)
tree4727124ac146c08d5eb09e31983e231623840b89 /indra/llui/lltoolbar.cpp
parentadeaf71e3314e44a33864dbe90d93040d4247c67 (diff)
EXP-1303 FIX Drag and dropping button over viewer area can select objects inworld
fixed close button not working on floaters against right edge of window fixed drag and drop only working once per toolbar button reimplemented drag and drop threshold
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r--indra/llui/lltoolbar.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 63a1706fe4..c34fbcd4f5 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -177,6 +177,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p)
center_panel_p.rect = getLocalRect();
center_panel_p.auto_resize = false;
center_panel_p.user_resize = false;
+ center_panel_p.mouse_opaque = false;
LLLayoutPanel* center_panel = LLUICtrlFactory::create<LLLayoutPanel>(center_panel_p);
mCenteringStack->addChild(center_panel);
@@ -557,7 +558,13 @@ void LLToolBar::draw()
{
if (mButtons.empty())
{
- return;
+ mButtonPanel->setVisible(FALSE);
+ mButtonPanel->setMouseOpaque(FALSE);
+ }
+ else
+ {
+ mButtonPanel->setVisible(TRUE);
+ mButtonPanel->setMouseOpaque(TRUE);
}
// Update enable/disable state and highlight state for editable toolbars
@@ -741,7 +748,11 @@ BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask)
// llinfos << "Merov debug: handleHover, x = " << x << ", y = " << y << ", mouse = " << hasMouseCapture() << llendl;
BOOL handled = FALSE;
- if (hasMouseCapture() && mStartDragItemCallback && mHandleDragItemCallback)
+ S32 mouse_distance_squared = (x - mMouseDownX) * (x - mMouseDownX) + (y - mMouseDownY) * (y - mMouseDownY);
+ S32 drag_threshold = LLUI::sSettingGroups["config"]->getS32("DragAndDropDistanceThreshold");
+ if (mouse_distance_squared > drag_threshold * drag_threshold
+ && hasMouseCapture() &&
+ mStartDragItemCallback && mHandleDragItemCallback)
{
if (!mIsDragged)
{
@@ -768,3 +779,8 @@ void LLToolBarButton::onMouseEnter(S32 x, S32 y, MASK mask)
// Always highlight toolbar buttons, even if they are disabled
mNeedsHighlight = TRUE;
}
+
+void LLToolBarButton::onMouseCaptureLost()
+{
+ mIsDragged = false;
+}