diff options
author | Oz Linden <oz@lindenlab.com> | 2011-04-02 07:07:49 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-04-02 07:07:49 -0400 |
commit | e58c809a5816383674d0f1957440fad728e88893 (patch) | |
tree | 83f1ff2c4bee8237c4557793143b2133623943a4 /indra/newview/llnearbychatbar.cpp | |
parent | f9af1f4fca028709b0262c0e8c40eefc2ab13d00 (diff) | |
parent | e6c0615b97019cf9c8aee267513757c0c2510420 (diff) |
merge changes for STORM-1131
Diffstat (limited to 'indra/newview/llnearbychatbar.cpp')
-rw-r--r-- | indra/newview/llnearbychatbar.cpp | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 932ad75f29..162e465fef 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -94,15 +94,19 @@ public: LLGestureComboList::Params::Params() : combo_button("combo_button"), - combo_list("combo_list") + combo_list("combo_list"), + get_more("get_more", true), + view_all("view_all", true) { } LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p) -: LLUICtrl(p) - , mLabel(p.label) - , mViewAllItemIndex(0) - , mGetMoreItemIndex(0) +: LLUICtrl(p), + mLabel(p.label), + mViewAllItemIndex(-1), + mGetMoreItemIndex(-1), + mShowViewAll(p.view_all), + mShowGetMore(p.get_more) { LLBottomtrayButton::Params button_params = p.combo_button; button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT); @@ -153,6 +157,16 @@ BOOL LLGestureComboList::handleKeyHere(KEY key, MASK mask) return handled; } +void LLGestureComboList::draw() +{ + LLUICtrl::draw(); + + if(mButton->getToggleState()) + { + showList(); + } +} + void LLGestureComboList::showList() { LLRect rect = mList->getRect(); @@ -176,6 +190,7 @@ void LLGestureComboList::showList() // Show the list and push the button down mButton->setToggleState(TRUE); mList->setVisible(TRUE); + sendChildToFront(mList); LLUI::addPopup(mList); } @@ -286,12 +301,16 @@ void LLGestureComboList::refreshGestures() sortByName(); // store indices for Get More and View All items (idx is the index followed by the last added Gesture) - mGetMoreItemIndex = idx; - mViewAllItemIndex = idx + 1; - - // add Get More and View All items at the bottom - mList->addSimpleElement(LLTrans::getString("GetMoreGestures"), ADD_BOTTOM, LLSD(mGetMoreItemIndex)); - mList->addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex)); + if (mShowGetMore) + { + mGetMoreItemIndex = idx; + mList->addSimpleElement(LLTrans::getString("GetMoreGestures"), ADD_BOTTOM, LLSD(mGetMoreItemIndex)); + } + if (mShowViewAll) + { + mViewAllItemIndex = idx + 1; + mList->addSimpleElement(LLTrans::getString("ViewAllGestures"), ADD_BOTTOM, LLSD(mViewAllItemIndex)); + } // Insert label after sorting, at top, with separator below it mList->addSeparator(ADD_TOP); |