diff options
Diffstat (limited to 'indra/llui/lllayoutstack.cpp')
-rw-r--r-- | indra/llui/lllayoutstack.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 5eade72b61..bac5491943 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -229,7 +229,7 @@ static void get_attribute_bool_and_write(LLXMLNodePtr node, LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) { LLLayoutStack::Params p(LLUICtrlFactory::getDefaultParams<LLLayoutStack>()); - LLXUIParser::instance().readXUI(node, p); + LLXUIParser::instance().readXUI(node, p, LLUICtrlFactory::getInstance()->getCurFileName()); // Export must happen before setupParams() mungles rectangles and before // this item gets added to parent (otherwise screws up last_child_rect @@ -401,6 +401,16 @@ void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed) panel_container->mCollapsed = collapsed; } +void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize) +{ + LayoutPanel* panel = findEmbeddedPanelByName(panel_name); + + if (panel) + { + panel->mAutoResize = auto_resize; + } +} + void LLLayoutStack::updateLayout(BOOL force_resize) { static LLUICachedControl<S32> resize_bar_overlap ("UIResizeBarOverlap", 0); @@ -713,6 +723,24 @@ LLLayoutStack::LayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) co return NULL; } +LLLayoutStack::LayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) const +{ + LayoutPanel* result = NULL; + + for (e_panel_list_t::const_iterator panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) + { + LayoutPanel* p = *panel_it; + + if (p->mPanel->getName() == name) + { + result = p; + break; + } + } + + return result; +} + // Compute sum of min_width or min_height of children void LLLayoutStack::calcMinExtents() { |