Skip to content
Snippets Groups Projects
Commit e67bc887 authored by Vadim ProductEngine's avatar Vadim ProductEngine
Browse files

STORM-1311 FIXED Provide more space for parcel description in the Place...

STORM-1311 FIXED Provide more space for parcel description in the Place Profile when coming from search.

This also affects the way teleport history items look.

In the first place I tried to make the description occupy all available space
and follow viewer window shape. However that triggered numerous bugs in the
text widgets, which spoiled the whole fix.
So I'm coming up with a temporary hacky solution that should fit
the ticket requirements.
parent d26356d7
Branches
Tags
No related merge requests found
...@@ -415,6 +415,15 @@ void LLExpandableTextBox::onTopLost() ...@@ -415,6 +415,15 @@ void LLExpandableTextBox::onTopLost()
LLUICtrl::onTopLost(); LLUICtrl::onTopLost();
} }
void LLExpandableTextBox::updateTextShape()
{
// I guess this should be done on every reshape(),
// but adding this code to reshape() currently triggers bug VWR-26455,
// which makes the text virtually unreadable.
llassert(!mExpanded);
updateTextBoxRect();
}
void LLExpandableTextBox::setValue(const LLSD& value) void LLExpandableTextBox::setValue(const LLSD& value)
{ {
collapseTextBox(); collapseTextBox();
......
...@@ -143,6 +143,10 @@ class LLExpandableTextBox : public LLUICtrl ...@@ -143,6 +143,10 @@ class LLExpandableTextBox : public LLUICtrl
*/ */
/*virtual*/ void onTopLost(); /*virtual*/ void onTopLost();
/**
* *HACK: Update the inner textbox shape.
*/
void updateTextShape();
/** /**
* Draws text box, collapses text box if its expanded and its parent's position changed * Draws text box, collapses text box if its expanded and its parent's position changed
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "llparcel.h" #include "llparcel.h"
#include "message.h" #include "message.h"
#include "llexpandabletextbox.h"
#include "lliconctrl.h" #include "lliconctrl.h"
#include "lllineeditor.h" #include "lllineeditor.h"
#include "lltextbox.h" #include "lltextbox.h"
...@@ -227,6 +228,34 @@ void LLPanelPlaceProfile::setInfoType(EInfoType type) ...@@ -227,6 +228,34 @@ void LLPanelPlaceProfile::setInfoType(EInfoType type)
getChild<LLAccordionCtrl>("advanced_info_accordion")->setVisible(is_info_type_agent); getChild<LLAccordionCtrl>("advanced_info_accordion")->setVisible(is_info_type_agent);
// If we came from search we want larger description area, approx. 10 lines (see STORM-1311).
// Don't use the maximum available space because that leads to nasty artifacts
// in text editor and expandable text box.
{
const S32 SEARCH_DESC_HEIGHT = 150;
// Remember original geometry (once).
static const S32 sOrigDescVPad = getChildView("parcel_title")->getRect().mBottom - mDescEditor->getRect().mTop;
static const S32 sOrigDescHeight = mDescEditor->getRect().getHeight();
static const S32 sOrigMRIconVPad = mDescEditor->getRect().mBottom - mMaturityRatingIcon->getRect().mTop;
static const S32 sOrigMRTextVPad = mDescEditor->getRect().mBottom - mMaturityRatingText->getRect().mTop;
// Resize the description.
const S32 desc_height = is_info_type_agent ? sOrigDescHeight : SEARCH_DESC_HEIGHT;
const S32 desc_top = getChildView("parcel_title")->getRect().mBottom - sOrigDescVPad;
LLRect desc_rect = mDescEditor->getRect();
desc_rect.setOriginAndSize(desc_rect.mLeft, desc_top - desc_height, desc_rect.getWidth(), desc_height);
mDescEditor->reshape(desc_rect.getWidth(), desc_rect.getHeight());
mDescEditor->setRect(desc_rect);
mDescEditor->updateTextShape();
// Move the maturity rating icon/text accordingly.
const S32 mr_icon_bottom = mDescEditor->getRect().mBottom - sOrigMRIconVPad - mMaturityRatingIcon->getRect().getHeight();
const S32 mr_text_bottom = mDescEditor->getRect().mBottom - sOrigMRTextVPad - mMaturityRatingText->getRect().getHeight();
mMaturityRatingIcon->setOrigin(mMaturityRatingIcon->getRect().mLeft, mr_icon_bottom);
mMaturityRatingText->setOrigin(mMaturityRatingText->getRect().mLeft, mr_text_bottom);
}
switch(type) switch(type)
{ {
case AGENT: case AGENT:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment