Skip to content

Commit

Permalink
#3405 MotD dynamic resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
akleshchev committed Jan 14, 2025
1 parent f34af8f commit 5cc2c72
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
19 changes: 19 additions & 0 deletions indra/newview/llprogressview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ bool LLProgressView::postBuild()

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

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

mLayoutPanel4 = getChild<LLView>("panel4");
mLayoutPanel4RectInitial = mLayoutPanel4->getRect();

mLayoutMOTD = getChild<LLView>("panel_motd");
mLayoutMOTDRectInitial = mLayoutMOTD->getRect();

getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle()));

getChild<LLTextBox>("message_text")->setClickedCallback(onClickMessage, this);
Expand Down Expand Up @@ -309,6 +316,18 @@ void LLProgressView::setMessage(const std::string& msg)
{
mMessage = msg;
mMessageText->setValue(mMessage);
S32 height = mMessageText->getTextPixelHeight();
S32 delta = height - mLayoutMOTDRectInitial.getHeight();
if (delta > 0)
{
mLayoutPanel4->reshape(mLayoutPanel4RectInitial.getWidth(), mLayoutPanel4RectInitial.getHeight() + delta);
mLayoutMOTD->reshape(mLayoutMOTDRectInitial.getWidth(), mLayoutMOTDRectInitial.getHeight() + delta);
}
else
{
mLayoutPanel4->reshape(mLayoutPanel4RectInitial.getWidth(), mLayoutPanel4RectInitial.getHeight());
mLayoutMOTD->reshape(mLayoutMOTDRectInitial.getWidth(), mLayoutMOTDRectInitial.getHeight());
}
}

void LLProgressView::initStartTexture(S32 location_id, bool is_in_production)
Expand Down
7 changes: 7 additions & 0 deletions indra/newview/llprogressview.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ class LLProgressView :
LLFrameTimer mFadeToWorldTimer;
LLFrameTimer mFadeFromLoginTimer;
LLRect mOutlineRect;
LLView* mLayoutPanel4 = nullptr;
LLView* mLayoutMOTD = nullptr;
// Rects for resizing purposes
LLRect mMessageTextRectInitial;
LLRect mLayoutPanel4RectInitial;
LLRect mLayoutMOTDRectInitial;

bool mMouseDownInActiveArea;
bool mStartupComplete;

Expand Down
18 changes: 9 additions & 9 deletions indra/newview/skins/default/xui/en/panel_progress.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
layout="topleft"
left="0"
orientation="vertical"
name="vertical_centering"
name="vertical_centering1"
top="0"
width="670">
<layout_panel
Expand All @@ -44,27 +44,27 @@
width="670" />
<layout_panel
auto_resize="false"
height="240"
height="220"
layout="topleft"
min_height="240"
min_height="220"
name="panel4"
width="670">
<icon
color="LoginProgressBoxCenterColor"
follows="left|right|bottom|top"
height="240"
image_name="Rounded_Square"
layout="topleft"
left="0"
top="0"
height="220"
width="670" />
<layout_stack
follows="left|right|top|bottom"
height="240"
height="220"
layout="topleft"
left="0"
orientation="vertical"
name="vertical_centering"
name="vertical_centering2"
animate="false"
top="0"
width="670">
Expand Down Expand Up @@ -113,9 +113,9 @@
</layout_panel>
<layout_panel
auto_resize="false"
height="110"
height="90"
layout="topleft"
min_height="110"
min_height="90"
name="panel_motd"
width="670">
<text
Expand All @@ -124,7 +124,7 @@
font_shadow="none"
halign="left"
valign="center"
height="100"
height="80"
layout="topleft"
left="45"
line_spacing.pixels="2"
Expand Down
4 changes: 2 additions & 2 deletions indra/newview/skins/default/xui/pl/panel_progress.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<panel name="login_progress_panel">
<layout_stack name="horizontal_centering">
<layout_panel name="center">
<layout_stack name="vertical_centering">
<layout_stack name="vertical_centering1">
<layout_panel name="panel4">
<layout_stack name="vertical_centering">
<layout_stack name="vertical_centering2">
</layout_stack>
</layout_panel>
</layout_stack>
Expand Down

0 comments on commit 5cc2c72

Please sign in to comment.