diff options
author | Oz Linden <oz@lindenlab.com> | 2010-12-24 09:08:20 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2010-12-24 09:08:20 -0500 |
commit | a9caa3151cea77b992c06c5a774d333ffd3016e1 (patch) | |
tree | 330cee487295788c500bcd7096a125120a10ae75 /indra/llui/lllayoutstack.cpp | |
parent | bdd07a7a648dc7e2c290d5aa837c22c20c4af31c (diff) | |
parent | ef1c3aac889d118530994e878d83426d4fc2ca7c (diff) |
merge fix for storm-411
Diffstat (limited to 'indra/llui/lllayoutstack.cpp')
-rw-r--r-- | indra/llui/lllayoutstack.cpp | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index ac30fce392..19ac4c58a8 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -38,6 +38,12 @@ static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack"); static LLLayoutStack::LayoutStackRegistry::Register<LLLayoutPanel> register_layout_panel("layout_panel"); +void LLLayoutStack::OrientationNames::declareValues() +{ + declare("horizontal", HORIZONTAL); + declare("vertical", VERTICAL); +} + // // LLLayoutPanel // @@ -47,47 +53,47 @@ LLLayoutPanel::LLLayoutPanel(const Params& p) mMaxDim(p.max_dim), mAutoResize(p.auto_resize), mUserResize(p.user_resize), - mCollapsed(FALSE), - mCollapseAmt(0.f), - mVisibleAmt(1.f), // default to fully visible - mResizeBar(NULL) - { + mCollapsed(FALSE), + mCollapseAmt(0.f), + mVisibleAmt(1.f), // default to fully visible + mResizeBar(NULL) +{ // panels initialized as hidden should not start out partially visible if (!getVisible()) - { + { mVisibleAmt = 0.f; - } - } + } +} void LLLayoutPanel::initFromParams(const Params& p) - { +{ LLPanel::initFromParams(p); setFollowsNone(); - } +} LLLayoutPanel::~LLLayoutPanel() - { - // probably not necessary, but... - delete mResizeBar; - mResizeBar = NULL; - } +{ + // probably not necessary, but... + delete mResizeBar; + mResizeBar = NULL; +} F32 LLLayoutPanel::getCollapseFactor(LLLayoutStack::ELayoutOrientation orientation) - { +{ if (orientation == LLLayoutStack::HORIZONTAL) - { - F32 collapse_amt = - clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinDim / (F32)llmax(1, getRect().getWidth())); - return mVisibleAmt * collapse_amt; - } - else + { + F32 collapse_amt = + clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinDim / (F32)llmax(1, getRect().getWidth())); + return mVisibleAmt * collapse_amt; + } + else { F32 collapse_amt = clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)mMinDim / (F32)llmax(1, getRect().getHeight()))); return mVisibleAmt * collapse_amt; - } } +} // // LLLayoutStack @@ -109,7 +115,7 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) mMinWidth(0), mMinHeight(0), mPanelSpacing(p.border_size), - mOrientation((p.orientation() == "vertical") ? VERTICAL : HORIZONTAL), + mOrientation(p.orientation), mAnimate(p.animate), mAnimatedThisFrame(false), mClip(p.clip), |