Skip to content
Snippets Groups Projects
Commit 0c3f6abc authored by Dmitry Zaporozhan's avatar Dmitry Zaporozhan
Browse files

Fixed low bug EXT-1326 - Pick info should contain vertical scroll-bar if...

Fixed low bug EXT-1326 - Pick info should contain vertical scroll-bar if height of viewer window less than Pick Info's height.

--HG--
branch : product-engine
parent 9c90822c
No related branches found
No related tags found
No related merge requests found
...@@ -284,6 +284,7 @@ void LLPanelPickInfo::setPickName(const std::string& name) ...@@ -284,6 +284,7 @@ void LLPanelPickInfo::setPickName(const std::string& name)
void LLPanelPickInfo::setPickDesc(const std::string& desc) void LLPanelPickInfo::setPickDesc(const std::string& desc)
{ {
childSetValue(XML_DESC, desc); childSetValue(XML_DESC, desc);
updateContentPanelRect();
} }
void LLPanelPickInfo::setPickLocation(const std::string& location) void LLPanelPickInfo::setPickLocation(const std::string& location)
...@@ -291,6 +292,31 @@ void LLPanelPickInfo::setPickLocation(const std::string& location) ...@@ -291,6 +292,31 @@ void LLPanelPickInfo::setPickLocation(const std::string& location)
childSetValue(XML_LOCATION, location); childSetValue(XML_LOCATION, location);
} }
void LLPanelPickInfo::updateContentPanelRect()
{
LLTextBox* desc = getChild<LLTextBox>(XML_DESC);
S32 text_height = desc->getTextPixelHeight();
LLRect text_rect = desc->getRect();
// let text-box height fit text height
text_rect.set(text_rect.mLeft, text_rect.mTop, text_rect.mRight, text_rect.mTop - text_height);
desc->setRect(text_rect);
desc->reshape(text_rect.getWidth(), text_rect.getHeight());
// force reflow
desc->setText(desc->getText());
// bottom of description text-box will be bottom of content panel
desc->localRectToOtherView(desc->getLocalRect(), &text_rect, getChild<LLView>("profile_scroll"));
LLPanel* content_panel = getChild<LLPanel>("scroll_content_panel");
LLRect content_rect = content_panel->getRect();
content_rect.set(content_rect.mLeft, content_rect.mTop, content_rect.mRight, text_rect.mBottom);
// Somehow setRect moves all elements down.
// Single reshape() updates rect and does not move anything.
content_panel->reshape(content_rect.getWidth(), content_rect.getHeight());
}
void LLPanelPickInfo::onClickMap() void LLPanelPickInfo::onClickMap()
{ {
LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal()); LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal());
......
...@@ -139,6 +139,15 @@ class LLPanelPickInfo : public LLPanel, public LLAvatarPropertiesObserver, LLRem ...@@ -139,6 +139,15 @@ class LLPanelPickInfo : public LLPanel, public LLAvatarPropertiesObserver, LLRem
virtual void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } virtual void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; }
virtual LLVector3d& getPosGlobal() { return mPosGlobal; } virtual LLVector3d& getPosGlobal() { return mPosGlobal; }
/**
* Reshapes content panel to fit all elements.
*
* Assume that description text-box is the last element of panel.
* Reshape text-box to fit text height and then reshape content panel to fit
* text-box bottom. EXT-1326
*/
void updateContentPanelRect();
/** /**
* Callback for "Map" button, opens Map * Callback for "Map" button, opens Map
*/ */
......
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