summaryrefslogtreecommitdiff
path: root/indra/llui/lllayoutstack.cpp
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2023-07-17 13:37:03 -0700
committerBrad Linden <brad@lindenlab.com>2023-07-17 13:37:03 -0700
commitf975cfd7361729195f2bb14d874e5eacc6140759 (patch)
tree471389ca5dab742aaf84c678c4dcef3433da8e9a /indra/llui/lllayoutstack.cpp
parent2f8f1c7a44f45490db5b5f040914e42aef2f5280 (diff)
parentec4135da63a3f3877222fba4ecb59b15650371fe (diff)
Merge remote-tracking branch 'origin/main' into DRTVWR-559
Diffstat (limited to 'indra/llui/lllayoutstack.cpp')
-rw-r--r--indra/llui/lllayoutstack.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 77938edf27..ae9dba5945 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -282,6 +282,17 @@ void LLLayoutStack::draw()
}
}
+void LLLayoutStack::deleteAllChildren()
+{
+ mPanels.clear();
+ LLView::deleteAllChildren();
+
+ // Not really needed since nothing is left to
+ // display, but for the sake of consistency
+ updateFractionalSizes();
+ mNeedsLayout = true;
+}
+
void LLLayoutStack::removeChild(LLView* view)
{
LLLayoutPanel* embedded_panelp = findEmbeddedPanel(dynamic_cast<LLPanel*>(view));
@@ -289,12 +300,14 @@ void LLLayoutStack::removeChild(LLView* view)
if (embedded_panelp)
{
mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp));
- delete embedded_panelp;
+ LLView::removeChild(view);
updateFractionalSizes();
mNeedsLayout = true;
}
-
- LLView::removeChild(view);
+ else
+ {
+ LLView::removeChild(view);
+ }
}
BOOL LLLayoutStack::postBuild()