Skip to content
Snippets Groups Projects
Commit a27706ad authored by Sergei Litovchuk's avatar Sergei Litovchuk
Browse files

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
parent f5bada7e
No related branches found
No related tags found
No related merge requests found
...@@ -57,7 +57,11 @@ LLPanelPlaceInfo::LLPanelPlaceInfo() ...@@ -57,7 +57,11 @@ LLPanelPlaceInfo::LLPanelPlaceInfo()
: LLPanel(), : LLPanel(),
mParcelID(), mParcelID(),
mRequestedID(), mRequestedID(),
mPosRegion() mPosRegion(),
mScrollingPanelMinHeight(0),
mScrollingPanelWidth(0),
mScrollingPanel(NULL),
mScrollContainer(NULL)
{} {}
//virtual //virtual
...@@ -83,6 +87,12 @@ BOOL LLPanelPlaceInfo::postBuild() ...@@ -83,6 +87,12 @@ BOOL LLPanelPlaceInfo::postBuild()
mMaturityRatingIcon = getChild<LLIconCtrl>("maturity_icon"); mMaturityRatingIcon = getChild<LLIconCtrl>("maturity_icon");
mMaturityRatingText = getChild<LLTextBox>("maturity_value"); 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; return TRUE;
} }
...@@ -230,6 +240,27 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) ...@@ -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<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 // virtual
void LLPanelPlaceInfo::handleVisibilityChange(BOOL new_visibility) void LLPanelPlaceInfo::handleVisibilityChange(BOOL new_visibility)
{ {
......
...@@ -45,6 +45,7 @@ class LLIconCtrl; ...@@ -45,6 +45,7 @@ class LLIconCtrl;
class LLInventoryItem; class LLInventoryItem;
class LLPanelPickEdit; class LLPanelPickEdit;
class LLParcel; class LLParcel;
class LLScrollContainer;
class LLTextBox; class LLTextBox;
class LLTextureCtrl; class LLTextureCtrl;
class LLViewerRegion; class LLViewerRegion;
...@@ -92,6 +93,7 @@ class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver ...@@ -92,6 +93,7 @@ class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
/*virtual*/ void handleVisibilityChange (BOOL new_visibility); /*virtual*/ void handleVisibilityChange (BOOL new_visibility);
// Create a pick for the location specified // Create a pick for the location specified
...@@ -110,8 +112,12 @@ class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver ...@@ -110,8 +112,12 @@ class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver
LLUUID mRequestedID; LLUUID mRequestedID;
LLVector3 mPosRegion; LLVector3 mPosRegion;
std::string mCurrentTitle; std::string mCurrentTitle;
S32 mScrollingPanelMinHeight;
S32 mScrollingPanelWidth;
INFO_TYPE mInfoType; INFO_TYPE mInfoType;
LLScrollContainer* mScrollContainer;
LLPanel* mScrollingPanel;
LLTextBox* mTitle; LLTextBox* mTitle;
LLTextureCtrl* mSnapshotCtrl; LLTextureCtrl* mSnapshotCtrl;
LLTextBox* mRegionName; LLTextBox* mRegionName;
......
...@@ -87,8 +87,8 @@ ...@@ -87,8 +87,8 @@
width="313"> width="313">
<panel <panel
bg_alpha_color="DkGray2" bg_alpha_color="DkGray2"
follows="all" follows="left|top|right"
height="533" height="610"
layout="topleft" layout="topleft"
left="0" left="0"
min_height="300" min_height="300"
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
top_pad="10" top_pad="10"
width="18" /> width="18" />
<text <text
follows="right|top" follows="left|top|right"
height="16" height="16"
layout="topleft" layout="topleft"
left_pad="8" left_pad="8"
......
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
width="313"> width="313">
<panel <panel
bg_alpha_color="DkGray2" bg_alpha_color="DkGray2"
follows="all" follows="left|top|right"
height="533" height="533"
layout="topleft" layout="topleft"
left="0" left="0"
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
<layout_stack <layout_stack
border_size="0" border_size="0"
clip="false" clip="false"
follows="all" follows="left|top|right"
height="50" height="50"
layout="topleft" layout="topleft"
mouse_opaque="false" mouse_opaque="false"
...@@ -305,7 +305,7 @@ ...@@ -305,7 +305,7 @@
top_delta="0" top_delta="0"
width="18" /> width="18" />
<text <text
follows="right|top" follows="left|top|right"
height="16" height="16"
layout="topleft" layout="topleft"
left_pad="8" left_pad="8"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment