summaryrefslogtreecommitdiff
path: root/indra/llui/lllayoutstack.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-09-21 14:25:48 -0700
committerMerov Linden <merov@lindenlab.com>2011-09-21 14:25:48 -0700
commit5ae6bbc848e0146bb4b5ea5dd4a5d26d2c5702ba (patch)
treecfd1c052aef51bfa95298613a95fc78f64c3aefc /indra/llui/lllayoutstack.cpp
parent7bc6e626f40a910b4a3e5b88161e96b9967bd24d (diff)
parent305b65f6f600b81de9a78e1246d2a5353cc3189b (diff)
EXP-1207 : merge with viewer-experience-fui
Diffstat (limited to 'indra/llui/lllayoutstack.cpp')
-rw-r--r--indra/llui/lllayoutstack.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index a250404292..0d1f608e61 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -55,6 +55,7 @@ LLLayoutPanel::LLLayoutPanel(const Params& p)
mMaxDim(p.max_dim),
mAutoResize(p.auto_resize),
mUserResize(p.user_resize),
+ mFitContent(p.fit_content),
mCollapsed(FALSE),
mCollapseAmt(0.f),
mVisibleAmt(1.f), // default to fully visible
@@ -104,6 +105,14 @@ F32 LLLayoutPanel::getCollapseFactor(LLLayoutStack::ELayoutOrientation orientati
}
}
+void LLLayoutPanel::fitToContent()
+{
+ if (mFitContent)
+ {
+ setShape(calcBoundingRect());
+ }
+}
+
//
// LLLayoutStack
//
@@ -324,6 +333,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
{
LLLayoutPanel* panelp = (*panel_it);
+ panelp->fitToContent();
if (panelp->getVisible())
{
if (mAnimate)
@@ -478,7 +488,9 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
{
// shrink proportionally to amount over minimum
// so we can do this in one pass
- delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_width - relevant_min) / (F32)shrink_headroom_available)) : 0;
+ delta_size = (shrink_headroom_available > 0)
+ ? llround((F32)pixels_to_distribute * ((F32)(cur_width - relevant_min) / (F32)shrink_headroom_available))
+ : 0;
shrink_headroom_available -= (cur_width - relevant_min);
}
else