summaryrefslogtreecommitdiff
path: root/indra/llui/llaccordionctrl.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2026-03-12 00:18:29 -0400
committerGitHub <noreply@github.com>2026-03-12 00:18:29 -0400
commit18db816ef7552785ffa26d6d0397efbb341a999f (patch)
tree9c289d5f63d0f52783520c0100c74fd4fb756549 /indra/llui/llaccordionctrl.cpp
parentbf347d15804c27348c84a55ab763f89b718e8aac (diff)
parente572093ef7e0ed4c9d94be4ecaae850bcdb73e54 (diff)
Merge pull request #5097 from secondlife/release/2026.01
2026.01
Diffstat (limited to 'indra/llui/llaccordionctrl.cpp')
-rw-r--r--indra/llui/llaccordionctrl.cpp39
1 files changed, 34 insertions, 5 deletions
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp
index 2cd394476e..ac8f7c2126 100644
--- a/indra/llui/llaccordionctrl.cpp
+++ b/indra/llui/llaccordionctrl.cpp
@@ -47,6 +47,8 @@ static constexpr F32 AUTO_SCROLL_RATE_ACCEL = 120.f;
static LLDefaultChildRegistry::Register<LLAccordionCtrl> t2("accordion");
+std::set<LLAccordionCtrl*> LLAccordionCtrl::sPendingArrange;
+
LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params)
, mFitParent(params.fit_parent)
, mNoVisibleTabsOrigString(params.no_visible_tabs_text.initial_value().asString())
@@ -163,7 +165,11 @@ bool LLAccordionCtrl::postBuild()
//---------------------------------------------------------------------------------
LLAccordionCtrl::~LLAccordionCtrl()
{
- mAccordionTabs.clear();
+ if (mArrangePending)
+ {
+ sPendingArrange.erase(this);
+ }
+ mAccordionTabs.clear();
}
//---------------------------------------------------------------------------------
@@ -184,7 +190,7 @@ void LLAccordionCtrl::reshape(S32 width, S32 height, bool called_from_parent)
// necessary text paddings can be set via h_pad and v_pad
mNoVisibleTabsHelpText->setRect(getLocalRect());
- arrange();
+ scheduleArrange();
}
//---------------------------------------------------------------------------------
@@ -325,7 +331,7 @@ void LLAccordionCtrl::addCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab)
mAccordionTabs.push_back(accordion_tab);
accordion_tab->setDropDownStateChangedCallback( boost::bind(&LLAccordionCtrl::onCollapseCtrlCloseOpen, this, (S16)(mAccordionTabs.size() - 1)) );
- arrange();
+ scheduleArrange();
}
void LLAccordionCtrl::removeCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab)
@@ -682,8 +688,9 @@ S32 LLAccordionCtrl::notifyParent(const LLSD& info)
std::string str_action = info["action"];
if (str_action == "size_changes")
{
- //
- arrange();
+ // Multiple children can request an arrange,
+ // but only need to do it once so schedule it for later.
+ scheduleArrange();
return 1;
}
if (str_action == "select_next")
@@ -925,3 +932,25 @@ void LLAccordionCtrl::collapseAllTabs()
arrange();
}
}
+
+void LLAccordionCtrl::scheduleArrange()
+{
+ if (!mArrangePending)
+ {
+ mArrangePending = true;
+ sPendingArrange.insert(this);
+ }
+}
+
+void LLAccordionCtrl::updateClass()
+{
+ for (LLAccordionCtrl* inst : sPendingArrange)
+ {
+ if (inst)
+ {
+ inst->mArrangePending = false;
+ inst->arrange();
+ }
+ }
+ sPendingArrange.clear();
+}