diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-11-19 13:36:27 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-11-19 13:36:27 -0500 |
commit | afbc78d0398d58c44b2b1fb692ce1a27577fc4b1 (patch) | |
tree | da4c6c1bd6e87b81b10a5b7bed6429373e6a89eb /indra/newview/llpanelplaceinfo.cpp | |
parent | 6cea252986ef6d33f2e37333a286362b8e0272c5 (diff) | |
parent | 3e46ee6274d04d91657da92953b167fe94eb7f59 (diff) |
Merging viewer-2-0 changes into avatar-pipeline branch
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llpanelplaceinfo.cpp')
-rw-r--r-- | indra/newview/llpanelplaceinfo.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 963d39de8a..6ba3790fe2 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -57,7 +57,11 @@ LLPanelPlaceInfo::LLPanelPlaceInfo() : LLPanel(), mParcelID(), mRequestedID(), - mPosRegion() + mPosRegion(), + mScrollingPanelMinHeight(0), + mScrollingPanelWidth(0), + mScrollingPanel(NULL), + mScrollContainer(NULL) {} //virtual @@ -83,6 +87,12 @@ BOOL LLPanelPlaceInfo::postBuild() mMaturityRatingIcon = getChild<LLIconCtrl>("maturity_icon"); mMaturityRatingText = getChild<LLTextBox>("maturity_value"); + mScrollingPanel = getChild<LLPanel>("scrolling_panel"); + mScrollContainer = getChild<LLScrollContainer>("place_scroll"); + + mScrollingPanelMinHeight = mScrollContainer->getScrolledViewRect().getHeight(); + mScrollingPanelWidth = mScrollingPanel->getRect().getWidth(); + return TRUE; } @@ -231,6 +241,27 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) } // virtual +void LLPanelPlaceInfo::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + LLPanel::reshape(width, height, called_from_parent); + + if (!mScrollContainer || !mScrollingPanel) + return; + + static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); + + S32 scroll_height = mScrollContainer->getRect().getHeight(); + if (mScrollingPanelMinHeight >= scroll_height) + { + mScrollingPanel->reshape(mScrollingPanelWidth, mScrollingPanelMinHeight); + } + else + { + mScrollingPanel->reshape(mScrollingPanelWidth + scrollbar_size, scroll_height); + } +} + +// virtual void LLPanelPlaceInfo::handleVisibilityChange(BOOL new_visibility) { LLPanel::handleVisibilityChange(new_visibility); |