diff options
author | Richard Nelson <richard@lindenlab.com> | 2011-10-15 18:10:44 -0700 |
---|---|---|
committer | Richard Nelson <richard@lindenlab.com> | 2011-10-15 18:10:44 -0700 |
commit | 7c2f2b526ad2b33f1e25378b5a05379de6aa0b5a (patch) | |
tree | b3eb319106fcd73f9ff704be3f69a7e741aab54e /indra/llui | |
parent | fc2bd1cce2e6c213fa682b9768d435a4e394a95e (diff) | |
parent | 0976964f8315aab5879678f07318267b6887ed95 (diff) |
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience-fui
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lltoolbar.cpp | 34 | ||||
-rw-r--r-- | indra/llui/lltoolbar.h | 4 |
2 files changed, 23 insertions, 15 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 97cf583a3c..226a218e47 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -422,7 +422,7 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y) LLRect button_rect; while (it_button != end_button) { - button_rect = (*it_button)->getRect(); + button_rect = (*it_button)->getRect(); S32 point_x = button_rect.mRight + mPadRight; S32 point_y = button_rect.mBottom - mPadBottom; @@ -444,11 +444,11 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y) S32 mid_point = (button_rect.mRight + button_rect.mLeft) / 2; if (button_panel_x < mid_point) { - mDragx = button_rect.mLeft - mPadLeft; - mDragy = button_rect.mTop + mPadTop; - } - else - { + mDragx = button_rect.mLeft - mPadLeft; + mDragy = button_rect.mTop + mPadTop; + } + else + { rank++; mDragx = button_rect.mRight + mPadRight - 1; mDragy = button_rect.mTop + mPadTop; @@ -475,12 +475,12 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y) { // We hit passed the end of the list so put the insertion point at the end if (orientation == LLLayoutStack::HORIZONTAL) - { + { mDragx = button_rect.mRight + mPadRight; mDragy = button_rect.mTop + mPadTop; - } - else - { + } + else + { mDragx = button_rect.mLeft - mPadLeft; mDragy = button_rect.mBottom - mPadBottom; } @@ -691,6 +691,7 @@ void LLToolBar::draw() if (command && btn->mIsEnabledSignal) { const bool button_command_enabled = (*btn->mIsEnabledSignal)(btn, command->isEnabledParameters()); + // TODO: make button appear disabled but have it still respond to drag and drop btn->setEnabled(button_command_enabled); } @@ -964,6 +965,16 @@ void LLToolBarButton::onMouseCaptureLost() mIsDragged = false; } +void LLToolBarButton::onCommit() +{ + LLCommand* command = LLCommandManager::instance().getCommand(mId); + + if (!mIsEnabledSignal || (*mIsEnabledSignal)(this, command->isEnabledParameters())) + { + LLButton::onCommit(); + } +} + void LLToolBarButton::reshape(S32 width, S32 height, BOOL called_from_parent) { LLButton::reshape(mWidthRange.clamp(width), height, called_from_parent); @@ -990,6 +1001,3 @@ const std::string LLToolBarButton::getToolTip() const - - - diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index e78c99cb37..f7ec318652 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -72,9 +72,9 @@ public: void onMouseEnter(S32 x, S32 y, MASK mask); void onMouseCaptureLost(); - virtual const std::string getToolTip() const; - + void onCommit(); + virtual const std::string getToolTip() const; private: LLCommandId mId; |