summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelpeople.cpp11
-rw-r--r--indra/newview/llpanelteleporthistory.cpp53
-rw-r--r--indra/newview/llpanelteleporthistory.h4
3 files changed, 60 insertions, 8 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 4ece380bfb..47d0381bd7 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -479,15 +479,10 @@ void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LL
bool expanded = param.asBoolean();
+ setAccordionCollapsedByUser(ctrl, !expanded);
if(!expanded)
{
avatar_list->resetSelection();
-
- setAccordionCollapsedByUser(ctrl, true);
- }
- else
- {
- setAccordionCollapsedByUser(ctrl, false);
}
}
@@ -1385,6 +1380,10 @@ bool LLPanelPeople::isAccordionCollapsedByUser(LLUICtrl* acc_tab)
}
LLSD param = acc_tab->getValue();
+ if(!param.has(COLLAPSED_BY_USER))
+ {
+ return false;
+ }
return param[COLLAPSED_BY_USER].asBoolean();
}
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index 67d0e13786..debb133573 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -51,6 +51,8 @@
// Used to limit time spent for items list update per frame.
static const U32 ADD_LIMIT = 50;
+static const std::string COLLAPSED_BY_USER = "collapsed_by_user";
+
class LLTeleportHistoryFlatItem : public LLPanel
{
public:
@@ -253,6 +255,10 @@ BOOL LLTeleportHistoryPanel::postBuild()
LLAccordionCtrlTab* tab = (LLAccordionCtrlTab*)*iter;
tab->setRightMouseDownCallback(boost::bind(&LLTeleportHistoryPanel::onAccordionTabRightClick, this, _1, _2, _3, _4));
tab->setDisplayChildren(false);
+ tab->setDropDownStateChangedCallback(boost::bind(&LLTeleportHistoryPanel::onAccordionExpand, this, _1, _2));
+
+ // All accordion tabs are collapsed initially
+ setAccordionCollapsedByUser(tab, true);
mItemContainers.put(tab);
@@ -269,10 +275,18 @@ BOOL LLTeleportHistoryPanel::postBuild()
// Open first 2 accordion tabs
if (mItemContainers.size() > 1)
- mItemContainers.get(mItemContainers.size() - 1)->setDisplayChildren(true);
+ {
+ LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 1);
+ tab->setDisplayChildren(true);
+ setAccordionCollapsedByUser(tab, false);
+ }
if (mItemContainers.size() > 2)
- mItemContainers.get(mItemContainers.size() - 2)->setDisplayChildren(true);
+ {
+ LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 2);
+ tab->setDisplayChildren(true);
+ setAccordionCollapsedByUser(tab, false);
+ }
}
getChild<LLPanel>("bottom_panel")->childSetAction("gear_btn",boost::bind(&LLTeleportHistoryPanel::onGearButtonClicked, this));
@@ -490,6 +504,18 @@ void LLTeleportHistoryPanel::refresh()
LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 1 - tab_idx);
tab->setVisible(true);
+ // Expand all accordion tabs when filtering
+ if(!mFilterSubString.empty())
+ {
+ tab->setDisplayChildren(true);
+ }
+ // Restore each tab's expand state when not filtering
+ else
+ {
+ bool collapsed = isAccordionCollapsedByUser(tab);
+ tab->setDisplayChildren(!collapsed);
+ }
+
curr_flat_view = getFlatListViewFromTab(tab);
}
@@ -774,3 +800,26 @@ void LLTeleportHistoryPanel::onGearButtonClicked()
LLMenuGL::showPopup(this, menu, menu_x, menu_y);
}
+void LLTeleportHistoryPanel::setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed)
+{
+ LLSD param = acc_tab->getValue();
+ param[COLLAPSED_BY_USER] = collapsed;
+ acc_tab->setValue(param);
+}
+
+bool LLTeleportHistoryPanel::isAccordionCollapsedByUser(LLUICtrl* acc_tab)
+{
+ LLSD param = acc_tab->getValue();
+ if(!param.has("acc_collapsed"))
+ {
+ return false;
+ }
+ return param[COLLAPSED_BY_USER].asBoolean();
+}
+
+void LLTeleportHistoryPanel::onAccordionExpand(LLUICtrl* ctrl, const LLSD& param)
+{
+ bool expanded = param.asBoolean();
+ // Save accordion tab state to restore it in refresh()
+ setAccordionCollapsedByUser(ctrl, !expanded);
+}
diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h
index a31ff34cb6..f646fea355 100644
--- a/indra/newview/llpanelteleporthistory.h
+++ b/indra/newview/llpanelteleporthistory.h
@@ -98,6 +98,10 @@ private:
LLFlatListView* getFlatListViewFromTab(LLAccordionCtrlTab *);
void onGearButtonClicked();
+ void setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed);
+ bool isAccordionCollapsedByUser(LLUICtrl* acc_tab);
+ void onAccordionExpand(LLUICtrl* ctrl, const LLSD& param);
+
LLTeleportHistoryStorage* mTeleportHistory;
LLAccordionCtrl* mHistoryAccordion;