summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2020-01-02 22:19:21 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2020-01-02 22:19:21 +0200
commitb6119253574cbc6ed355f342c056a4a198001a20 (patch)
tree6066d4df4779ef19907bf85ced0cf49dfd0b68f2 /indra
parentb006dc46394a46d30da9868f11e3f3bef5294dee (diff)
SL-12484 EXP-696 Remade "Remember Password" checkbox to be multiline
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llcheckboxctrl.cpp34
-rw-r--r--indra/llui/lltextbase.h2
-rw-r--r--indra/newview/skins/default/xui/en/panel_login.xml4
3 files changed, 31 insertions, 9 deletions
diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp
index eee6339caf..f5b64d58b0 100644
--- a/indra/llui/llcheckboxctrl.cpp
+++ b/indra/llui/llcheckboxctrl.cpp
@@ -87,18 +87,27 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p)
}
mLabel = LLUICtrlFactory::create<LLTextBox> (tbparams);
mLabel->reshapeToFitText();
- addChild(mLabel);
-
LLRect label_rect = mLabel->getRect();
+ if (mLabel->getLineCount() > 1)
+ {
+ // reshapeToFitText uses LLView::reshape() which always reshapes
+ // from bottom to top, but we want to extend the bottom
+ // Note: might be better idea to use getRect().mTop of LLCheckBoxCtrl (+pad) as top point of new rect
+ S32 delta = ll_round((F32)mLabel->getFont()->getLineHeight() * mLabel->getLineSpacingMult()) - label_rect.getHeight();
+ label_rect.translate(0, delta);
+ mLabel->setRect(label_rect);
+ }
+
+ addChild(mLabel);
// Button
- // Note: button cover the label by extending all the way to the right.
+ // Note: button cover the label by extending all the way to the right and down.
LLRect btn_rect = p.check_button.rect();
btn_rect.setOriginAndSize(
btn_rect.mLeft,
- btn_rect.mBottom,
+ llmin(btn_rect.mBottom, label_rect.mBottom),
llmax(btn_rect.mRight, label_rect.mRight - btn_rect.mLeft),
- llmax( label_rect.getHeight(), btn_rect.mTop));
+ llmax(label_rect.getHeight(), btn_rect.mTop));
std::string active_true_id, active_false_id;
std::string inactive_true_id, inactive_false_id;
@@ -152,17 +161,26 @@ void LLCheckBoxCtrl::clear()
void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent)
{
-
+ S32 label_top = mLabel->getRect().mTop;
mLabel->reshapeToFitText();
LLRect label_rect = mLabel->getRect();
+ if (label_top != label_rect.mTop)
+ {
+ // reshapeToFitText uses LLView::reshape() which always reshapes
+ // from bottom to top, but we want to extend the bottom so
+ // reposition control
+ S32 delta = label_top - label_rect.mTop;
+ label_rect.translate(0, delta);
+ mLabel->setRect(label_rect);
+ }
// Button
- // Note: button cover the label by extending all the way to the right.
+ // Note: button cover the label by extending all the way to the right and down.
LLRect btn_rect = mButton->getRect();
btn_rect.setOriginAndSize(
btn_rect.mLeft,
- btn_rect.mBottom,
+ llmin(btn_rect.mBottom, label_rect.mBottom),
llmax(btn_rect.getWidth(), label_rect.mRight - btn_rect.mLeft),
llmax(label_rect.mTop - btn_rect.mBottom, btn_rect.getHeight()));
mButton->setShape(btn_rect);
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index 4239cdf43c..058b804714 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -441,6 +441,8 @@ public:
S32 getVPad() { return mVPad; }
S32 getHPad() { return mHPad; }
+ F32 getLineSpacingMult() { return mLineSpacingMult; }
+ S32 getLineSpacingPixels() { return mLineSpacingPixels; } // only for multiline
S32 getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round, bool hit_past_end_of_line = true) const;
LLRect getLocalRectFromDocIndex(S32 pos) const;
diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml
index f8bdec3866..281ebeca9c 100644
--- a/indra/newview/skins/default/xui/en/panel_login.xml
+++ b/indra/newview/skins/default/xui/en/panel_login.xml
@@ -148,9 +148,11 @@
left="408"
bottom_delta="0"
label="Remember password"
+ label_text.word_wrap="true"
+ label_text.width="150"
check_button.bottom="3"
name="remember_check"
- width="145" />
+ width="170" />
<combo_box
allow_text_entry="false"
font="SansSerifTiny"