diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llcommandmanager.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llfloater.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lltoolbar.cpp | 25 | ||||
-rw-r--r-- | indra/llui/lltoolbar.h | 1 |
4 files changed, 26 insertions, 6 deletions
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 9ce7533e1b..1b87f20d12 100644 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -152,7 +152,7 @@ bool LLCommandManager::load() if (!commandsParams.validateBlock()) { - llerrs << "Unable to validate commands param block from file: " << commands_file << llendl; + llerrs << "Invalid commands file: " << commands_file << llendl; return false; } diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c28bcc2ec9..cc49238a0b 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -840,9 +840,9 @@ void LLFloater::applyRectControl() if (mRectControl.size() > 1) { const LLRect& rect = getControlGroup()->getRect(mRectControl); - if (rect.getWidth() > 0 && rect.getHeight() > 0) + if (rect.notEmpty()) { - translate( rect.mLeft - getRect().mLeft, rect.mBottom - getRect().mBottom); + setOrigin(rect.mLeft, rect.mBottom); if (mResizable) { reshape(llmax(mMinWidth, rect.getWidth()), llmax(mMinHeight, rect.getHeight())); diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 63a1706fe4..1f5fa5f361 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 @@ -716,7 +723,10 @@ LLToolBarButton::LLToolBarButton(const Params& p) mId(""), mIsEnabledSignal(NULL), mIsRunningSignal(NULL), - mIsStartingSignal(NULL) + mIsStartingSignal(NULL), + mIsDragged(false), + mStartDragItemCallback(NULL), + mHandleDragItemCallback(NULL) { mButtonFlashRate = 0.0; mButtonFlashCount = 0; @@ -741,7 +751,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 +782,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; +} diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 3fbe5a7703..4fac081130 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -68,6 +68,7 @@ public: void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } void onMouseEnter(S32 x, S32 y, MASK mask); + void onMouseCaptureLost(); private: LLCommandId mId; |