diff options
author | Merov Linden <merov@lindenlab.com> | 2011-10-05 11:49:12 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2011-10-05 11:49:12 -0700 |
commit | fb7af4d0010f9d14cb5464bed83d9e022dbe0d1a (patch) | |
tree | 06ad01cfdcb57366bcee48cdb0811f6982417d11 /indra/llui/lltoolbar.cpp | |
parent | 3b3a13707309eb4b7d6ed5d309081c99e5f28eca (diff) | |
parent | 5d08d1e3bd2de3e0e66ef836ada714fce98733b4 (diff) |
EXP-1202 : pull from richard/viewer-experience-fui
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r-- | indra/llui/lltoolbar.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index c349bbcf2e..07beb147d7 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -368,7 +368,7 @@ void LLToolBar::resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row { if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL) { - button->reshape(llclamp(button->getRect().getWidth(), button->mMinWidth, button->mMaxWidth), max_row_girth); + button->reshape(button->mWidthRange.clamp(button->getRect().getWidth()), max_row_girth); } else // VERTICAL { @@ -454,10 +454,10 @@ void LLToolBar::updateLayoutAsNeeded() BOOST_FOREACH(LLToolBarButton* button, mButtons) { - button->reshape(button->mMinWidth, button->mDesiredHeight); + button->reshape(button->mWidthRange.getMin(), button->mDesiredHeight); button->autoResize(); - S32 button_clamped_width = llclamp(button->getRect().getWidth(), button->mMinWidth, button->mMaxWidth); + S32 button_clamped_width = button->mWidthRange.clamp(button->getRect().getWidth()); S32 button_length = (orientation == LLLayoutStack::HORIZONTAL) ? button_clamped_width : button->getRect().getHeight(); @@ -472,7 +472,7 @@ void LLToolBar::updateLayoutAsNeeded() { if (orientation == LLLayoutStack::VERTICAL) { // row girth (width in this case) is clamped to allowable button widths - max_row_girth = llclamp(max_row_girth, button->mMinWidth, button->mMaxWidth); + max_row_girth = button->mWidthRange.clamp(max_row_girth); } // make buttons in current row all same girth @@ -601,8 +601,8 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) if (!mReadOnly) { LLUICtrl::CommitCallbackParam cbParam; - cbParam.function_name = commandp->functionName(); - cbParam.parameter = commandp->parameter(); + cbParam.function_name = commandp->executeFunctionName(); + cbParam.parameter = commandp->executeParameters(); button->setCommitCallback(cbParam); button->setStartDragCallback(mStartDragItemCallback); button->setHandleDragCallback(mHandleDragItemCallback); @@ -642,8 +642,7 @@ LLToolBarButton::LLToolBarButton(const Params& p) : LLButton(p), mMouseDownX(0), mMouseDownY(0), - mMinWidth(p.min_button_width), - mMaxWidth(p.max_button_width), + mWidthRange(p.button_width), mDesiredHeight(p.desired_height), mId("") { @@ -656,7 +655,7 @@ BOOL LLToolBarButton::handleMouseDown(S32 x, S32 y, MASK mask) return LLButton::handleMouseDown(x, y, mask); } -BOOL LLToolBarButton::handleHover( S32 x, S32 y, MASK mask ) +BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask) { // llinfos << "Merov debug: handleHover, x = " << x << ", y = " << y << ", mouse = " << hasMouseCapture() << llendl; BOOL handled = FALSE; |