diff options
author | richard <none@none> | 2009-12-21 18:12:17 -0800 |
---|---|---|
committer | richard <none@none> | 2009-12-21 18:12:17 -0800 |
commit | 18e25641fecd526cd2a2bb074311056101b3456a (patch) | |
tree | 3ff89da9566a7f7b602b201d19bda7ff43c99134 /indra/llui/llview.cpp | |
parent | e6a8b3e2b2b3a352c674a788d27ac2d5f35983f8 (diff) | |
parent | 5b978865e3b09e5b911728cd6381a2a4a7b3a9d3 (diff) |
merge
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r-- | indra/llui/llview.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index a8d8626e49..f1b08c380b 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -126,7 +126,7 @@ LLView::LLView(const LLView::Params& p) : mName(p.name), mParentView(NULL), mReshapeFlags(FOLLOWS_NONE), - mSaveToXML(p.from_xui), + mFromXUI(p.from_xui), mIsFocusRoot(FALSE), mLastVisible(FALSE), mNextInsertionOrdinal(0), @@ -2479,7 +2479,7 @@ static bool get_last_child_rect(LLView* parent, LLRect *rect) for (;itor != parent->getChildList()->end(); ++itor) { LLView *last_view = (*itor); - if (last_view->getSaveToXML()) + if (last_view->getFromXUI()) { *rect = last_view->getRect(); return true; @@ -2489,7 +2489,7 @@ static bool get_last_child_rect(LLView* parent, LLRect *rect) } //static -void LLView::setupParams(LLView::Params& p, LLView* parent) +void LLView::applyXUILayout(LLView::Params& p, LLView* parent) { const S32 VPAD = 4; const S32 MIN_WIDGET_HEIGHT = 10; @@ -2509,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 && p.from_xui) + if (layout_topleft) { //invert top to bottom if (p.rect.top.isProvided()) p.rect.top = parent_rect.getHeight() - p.rect.top; @@ -2535,10 +2535,10 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) p.rect.right.setProvided(false); // recalculate the right } } - else if (p.from_xui) // only do negative coordinate magic for XUI + else { - 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(); + if (p.rect.left.isProvided() && p.rect.left < 0) p.rect.left = p.rect.left + parent_rect.getWidth(); + if (p.rect.right.isProvided() && p.rect.right < 0) p.rect.right = p.rect.right + parent_rect.getWidth(); } if (p.center_vert) { @@ -2556,15 +2556,15 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) p.rect.top.setProvided(false); // recalculate the top } } - else if (p.from_xui) + else { - 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(); + if (p.rect.bottom.isProvided() && p.rect.bottom < 0) p.rect.bottom = p.rect.bottom + parent_rect.getHeight(); + if (p.rect.top.isProvided() && p.rect.top < 0) p.rect.top = p.rect.top + parent_rect.getHeight(); } // DEPRECATE: automatically fall back to height of MIN_WIDGET_HEIGHT pixels - if (!p.rect.height.isProvided() && !p.rect.top.isProvided()) + if (!p.rect.height.isProvided() && !p.rect.top.isProvided() && p.rect.height == 0) { p.rect.height = MIN_WIDGET_HEIGHT; } @@ -2663,7 +2663,7 @@ static void convert_to_relative_layout(LLView::Params& p, LLView* parent) // Use setupParams to get the final widget rectangle // according to our wacky layout rules. LLView::Params final = p; - LLView::setupParams(final, parent); + LLView::applyXUILayout(final, parent); // Must actually extract the rectangle to get consistent // right = left+width, top = bottom+height LLRect final_rect = final.rect; |