summaryrefslogtreecommitdiff
path: root/indra/llui/llview.cpp
diff options
context:
space:
mode:
authorrichard <none@none>2009-12-18 15:18:16 -0800
committerrichard <none@none>2009-12-18 15:18:16 -0800
commit2b22831dd0fffde8345a7b933ace46be818dec9a (patch)
tree8f8426c9be937210b3ebd08a517e3d712367720d /indra/llui/llview.cpp
parentebb69c31882f96bf3afdc719a739c3dca695c352 (diff)
ext-3307 - nearby chat stays scrolled at bottom
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r--indra/llui/llview.cpp24
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;