From a27706ad2e42718ad107e25fe7c29f1c0513fabc Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Wed, 18 Nov 2009 19:49:49 +0200 Subject: Fixed normal bug EXT-2461 "Edit Landmark panel isn't resized": - Added vertical scroll appearing for Place Profile and Landmark info panels. - Added horizontal reshaping to avoid redundant horizontal scroll. --HG-- branch : product-engine --- indra/newview/llpanelplaceinfo.cpp | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelplaceinfo.cpp') 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("maturity_icon"); mMaturityRatingText = getChild("maturity_value"); + mScrollingPanel = getChild("scrolling_panel"); + mScrollContainer = getChild("place_scroll"); + + mScrollingPanelMinHeight = mScrollContainer->getScrolledViewRect().getHeight(); + mScrollingPanelWidth = mScrollingPanel->getRect().getWidth(); + return TRUE; } @@ -230,6 +240,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 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) { -- cgit v1.2.3