diff options
author | richard <none@none> | 2009-12-17 11:49:41 -0800 |
---|---|---|
committer | richard <none@none> | 2009-12-17 11:49:41 -0800 |
commit | c84b6a28a0f99961d115f41d7238869dc92e728c (patch) | |
tree | 2ccae6ed053b1ce15e164de943a51211674e90eb | |
parent | 7a3034f738b0b2523ca919789fe4e7241faa1359 (diff) |
made setupParams do coordinate flipping and negative coordinate magic only for XUI-based params
-rw-r--r-- | indra/llui/llfloater.cpp | 1 | ||||
-rw-r--r-- | indra/llui/lllayoutstack.cpp | 1 | ||||
-rw-r--r-- | indra/llui/llpanel.cpp | 1 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.h | 25 | ||||
-rw-r--r-- | indra/llui/llview.cpp | 7 |
5 files changed, 10 insertions, 25 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 5fd707fea3..f7fd2dbdfe 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2716,6 +2716,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o params.rect.left.set(0); } + params.from_xui = true; setupParams(params, parent); initFromParams(params); diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 1fb618adee..5e15fa3919 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -246,6 +246,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o output_node, output_params, &default_params); } + p.from_xui = true; setupParams(p, parent); LLLayoutStack* layout_stackp = LLUICtrlFactory::create<LLLayoutStack>(p); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index de2b43bf13..738a96f730 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -541,6 +541,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu output_node, output_params, &default_params); } + params.from_xui = true; setupParams(params, parent); { LLFastTimer timer(FTM_PANEL_CONSTRUCTION); diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index cad62c27de..6788f29ba9 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -184,6 +184,8 @@ public: { T* widget = NULL; + T::setupParams(params, parent); + if (!params.validateBlock()) { llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl; @@ -307,27 +309,8 @@ fail: } // Apply layout transformations, usually munging rect - T::setupParams(params, parent); - - if (!params.validateBlock()) - { - llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl; - } - T* widget; - { - LLFastTimer timer(FTM_WIDGET_CONSTRUCTION); - widget = new T(params); - } - { - LLFastTimer timer(FTM_INIT_FROM_PARAMS); - widget->initFromParams(params); - } - - if (parent) - { - S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : -1; - setCtrlParent(widget, parent, tab_group); - } + params.from_xui = true; + T* widget = createWidget<T>(params, parent); typedef typename T::child_registry_t registry_t; diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 9f6fc1f298..a8d8626e49 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -2501,7 +2501,6 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) p.layout = parent->getLayout(); } - p.from_xui = true; if (parent) { @@ -2510,7 +2509,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) LLRect last_rect = parent->getLocalRect(); bool layout_topleft = (p.layout() == "topleft"); - if (layout_topleft) + if (layout_topleft && p.from_xui) { //invert top to bottom if (p.rect.top.isProvided()) p.rect.top = parent_rect.getHeight() - p.rect.top; @@ -2536,7 +2535,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) p.rect.right.setProvided(false); // recalculate the right } } - else + else if (p.from_xui) // only do negative coordinate magic for XUI { if (p.rect.left < 0) p.rect.left = p.rect.left + parent_rect.getWidth(); if (p.rect.right < 0) p.rect.right = p.rect.right + parent_rect.getWidth(); @@ -2557,7 +2556,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) p.rect.top.setProvided(false); // recalculate the top } } - else + else if (p.from_xui) { if (p.rect.bottom < 0) p.rect.bottom = p.rect.bottom + parent_rect.getHeight(); if (p.rect.top < 0) p.rect.top = p.rect.top + parent_rect.getHeight(); |