Skip to content

Commit c2d4919

Browse files
committed
#3405 MotD dynamic resizing
1 parent f34af8f commit c2d4919

File tree

4 files changed

+37
-11
lines changed

4 files changed

+37
-11
lines changed

indra/newview/llprogressview.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ bool LLProgressView::postBuild()
8383

8484
mProgressText = getChild<LLTextBox>("progress_text");
8585
mMessageText = getChild<LLTextBox>("message_text");
86+
mMessageTextRectInitial = mMessageText->getRect(); // auto resizes, save initial size
8687

8788
// media control that is used to play intro video
8889
mMediaCtrl = getChild<LLMediaCtrl>("login_media_panel");
@@ -94,6 +95,12 @@ bool LLProgressView::postBuild()
9495
mCancelBtn = getChild<LLButton>("cancel_btn");
9596
mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL );
9697

98+
mLayoutPanel4 = getChild<LLView>("panel4");
99+
mLayoutPanel4RectInitial = mLayoutPanel4->getRect();
100+
101+
mLayoutMOTD = getChild<LLView>("panel_motd");
102+
mLayoutMOTDRectInitial = mLayoutMOTD->getRect();
103+
97104
getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle()));
98105

99106
getChild<LLTextBox>("message_text")->setClickedCallback(onClickMessage, this);
@@ -309,6 +316,18 @@ void LLProgressView::setMessage(const std::string& msg)
309316
{
310317
mMessage = msg;
311318
mMessageText->setValue(mMessage);
319+
S32 height = mMessageText->getTextPixelHeight();
320+
S32 delta = height - mMessageTextRectInitial.getHeight();
321+
if (delta > 0)
322+
{
323+
mLayoutPanel4->reshape(mLayoutPanel4RectInitial.getWidth(), mLayoutPanel4RectInitial.getHeight() + delta);
324+
mLayoutMOTD->reshape(mLayoutMOTDRectInitial.getWidth(), mLayoutMOTDRectInitial.getHeight() + delta);
325+
}
326+
else
327+
{
328+
mLayoutPanel4->reshape(mLayoutPanel4RectInitial.getWidth(), mLayoutPanel4RectInitial.getHeight());
329+
mLayoutMOTD->reshape(mLayoutMOTDRectInitial.getWidth(), mLayoutMOTDRectInitial.getHeight());
330+
}
312331
}
313332

314333
void LLProgressView::initStartTexture(S32 location_id, bool is_in_production)

indra/newview/llprogressview.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ class LLProgressView :
9393
LLFrameTimer mFadeToWorldTimer;
9494
LLFrameTimer mFadeFromLoginTimer;
9595
LLRect mOutlineRect;
96+
LLView* mLayoutPanel4 = nullptr;
97+
LLView* mLayoutMOTD = nullptr;
98+
// Rects for resizing purposes
99+
LLRect mMessageTextRectInitial;
100+
LLRect mLayoutPanel4RectInitial;
101+
LLRect mLayoutMOTDRectInitial;
102+
96103
bool mMouseDownInActiveArea;
97104
bool mStartupComplete;
98105

indra/newview/skins/default/xui/en/panel_progress.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
layout="topleft"
3434
left="0"
3535
orientation="vertical"
36-
name="vertical_centering"
36+
name="vertical_centering1"
3737
top="0"
3838
width="670">
3939
<layout_panel
@@ -44,27 +44,27 @@
4444
width="670" />
4545
<layout_panel
4646
auto_resize="false"
47-
height="240"
47+
height="220"
4848
layout="topleft"
49-
min_height="240"
49+
min_height="220"
5050
name="panel4"
5151
width="670">
5252
<icon
5353
color="LoginProgressBoxCenterColor"
5454
follows="left|right|bottom|top"
55-
height="240"
5655
image_name="Rounded_Square"
5756
layout="topleft"
5857
left="0"
5958
top="0"
59+
height="220"
6060
width="670" />
6161
<layout_stack
6262
follows="left|right|top|bottom"
63-
height="240"
63+
height="220"
6464
layout="topleft"
6565
left="0"
6666
orientation="vertical"
67-
name="vertical_centering"
67+
name="vertical_centering2"
6868
animate="false"
6969
top="0"
7070
width="670">
@@ -113,9 +113,9 @@
113113
</layout_panel>
114114
<layout_panel
115115
auto_resize="false"
116-
height="110"
116+
height="90"
117117
layout="topleft"
118-
min_height="110"
118+
min_height="90"
119119
name="panel_motd"
120120
width="670">
121121
<text
@@ -124,7 +124,7 @@
124124
font_shadow="none"
125125
halign="left"
126126
valign="center"
127-
height="100"
127+
height="80"
128128
layout="topleft"
129129
left="45"
130130
line_spacing.pixels="2"

indra/newview/skins/default/xui/pl/panel_progress.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<panel name="login_progress_panel">
33
<layout_stack name="horizontal_centering">
44
<layout_panel name="center">
5-
<layout_stack name="vertical_centering">
5+
<layout_stack name="vertical_centering1">
66
<layout_panel name="panel4">
7-
<layout_stack name="vertical_centering">
7+
<layout_stack name="vertical_centering2">
88
</layout_stack>
99
</layout_panel>
1010
</layout_stack>

0 commit comments

Comments
 (0)