diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llmenugl.cpp | 28 | ||||
-rw-r--r-- | indra/llui/llmenugl.h | 4 | ||||
-rw-r--r-- | indra/llui/llnotifications.cpp | 9 | ||||
-rw-r--r-- | indra/llui/llpanel.cpp | 8 |
4 files changed, 38 insertions, 11 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 5fb0e57c06..0762d7c12d 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -2179,7 +2179,9 @@ void LLMenuGL::arrange( void ) { if ((*item_iter)->getVisible()) { - if (!getTornOff() && width + (*item_iter)->getNominalWidth() > max_width - spillover_item_width) + if (!getTornOff() + && item_iter != mItems.begin() // Don't spillover the first item! + && width + (*item_iter)->getNominalWidth() > max_width - spillover_item_width) { // no room for any more items createSpilloverBranch(); @@ -2189,15 +2191,15 @@ void LLMenuGL::arrange( void ) { LLMenuItemGL* itemp = (*spillover_iter); removeChild(itemp); - mSpilloverMenu->append(itemp); + mSpilloverMenu->appendNoArrange(itemp); // *NOTE:Mani Favor addChild() in merge with skinning } + mSpilloverMenu->arrange(); // *NOTE: Mani Remove line in merge with skinning/viewer2.0 branch + mSpilloverMenu->updateParent(LLMenuGL::sMenuContainer); // *NOTE: Mani Remove line in merge with skinning/viewer2.0 branch mItems.erase(item_iter, mItems.end()); - mItems.push_back(mSpilloverBranch); addChild(mSpilloverBranch); height = llmax(height, mSpilloverBranch->getNominalHeight()); width += mSpilloverBranch->getNominalWidth(); - break; } else @@ -2216,7 +2218,9 @@ void LLMenuGL::arrange( void ) { if ((*item_iter)->getVisible()) { - if (!getTornOff() && height + (*item_iter)->getNominalHeight() > max_height - spillover_item_height) + if (!getTornOff() + && item_iter != mItems.begin() // Don't spillover the first item! + && height + (*item_iter)->getNominalHeight() > max_height - spillover_item_height) { // no room for any more items createSpilloverBranch(); @@ -2226,14 +2230,15 @@ void LLMenuGL::arrange( void ) { LLMenuItemGL* itemp = (*spillover_iter); removeChild(itemp); - mSpilloverMenu->append(itemp); + mSpilloverMenu->appendNoArrange(itemp); // *NOTE:Mani Favor addChild() in merge with skinning } + mSpilloverMenu->arrange(); // *NOTE: Mani Remove line in merge with skinning/viewer2.0 branch + mSpilloverMenu->updateParent(LLMenuGL::sMenuContainer); // *NOTE: Mani Remove line in merge with skinning/viewer2.0 branch mItems.erase(item_iter, mItems.end()); mItems.push_back(mSpilloverBranch); addChild(mSpilloverBranch); height += mSpilloverBranch->getNominalHeight(); width = llmax( width, mSpilloverBranch->getNominalWidth() ); - break; } else @@ -2478,6 +2483,15 @@ BOOL LLMenuGL::append( LLMenuItemGL* item ) return TRUE; } +// *NOTE:Mani - appendNoArrange() should be removed when merging to skinning/viewer2.0 +// Its added as a fix to a viewer 1.23 bug that has already been address by skinning work. +BOOL LLMenuGL::appendNoArrange( LLMenuItemGL* item ) +{ + mItems.push_back( item ); + addChild( item ); + return TRUE; +} + // add a separator to this menu BOOL LLMenuGL::appendSeparator( const std::string &separator_name ) { diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index a2ef968bcd..030b81b58c 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -439,6 +439,10 @@ public: // Add the menu item to this menu. virtual BOOL append( LLMenuItemGL* item ); + // *NOTE:Mani - appendNoArrange() should be removed when merging to skinning/viewer2.0 + // Its added as a fix to a viewer 1.23 bug that has already been address by skinning work. + virtual BOOL appendNoArrange( LLMenuItemGL* item ); + // add a separator to this menu virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null ); diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 2ae96726af..6b7dd0a3de 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -310,7 +310,7 @@ void LLNotificationForm::addElement(const std::string& type, const std::string& LLSD element; element["type"] = type; element["name"] = name; - element["label"] = name; + element["text"] = name; element["value"] = value; element["index"] = mFormData.size(); mFormData.append(element); @@ -525,7 +525,12 @@ std::string LLNotification::getSelectedOptionName(const LLSD& response) void LLNotification::respond(const LLSD& response) { mRespondedTo = true; - LLNotificationFunctorRegistry::instance().getFunctor(mResponseFunctorName)(asLLSD(), response); + // look up the functor + LLNotificationFunctorRegistry::ResponseFunctor functor = + LLNotificationFunctorRegistry::instance().getFunctor(mResponseFunctorName); + // and then call it + functor(asLLSD(), response); + if (mTemporaryResponder) { LLNotificationFunctorRegistry::instance().unregisterFunctor(mResponseFunctorName); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 92d045d114..28780c7adb 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -1085,11 +1085,15 @@ struct LLLayoutStack::LLEmbeddedPanel { if (mOrientation == HORIZONTAL) { - return mVisibleAmt * clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinWidth / (F32)mPanel->getRect().getWidth()); + F32 collapse_amt = + clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinWidth / (F32)llmax(1, mPanel->getRect().getWidth())); + return mVisibleAmt * collapse_amt; } else { - return mVisibleAmt * clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinHeight / (F32)mPanel->getRect().getHeight()); + F32 collapse_amt = + clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)mMinHeight / (F32)llmax(1, mPanel->getRect().getHeight()))); + return mVisibleAmt * collapse_amt; } } |