diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-01-14 23:37:02 +0200 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-01-15 17:29:36 +0200 |
commit | c2d491905b668702d5640c7c5472629f7acc27e0 (patch) | |
tree | 3a4861d820d1bbba3b36484fecd62b4acde3de14 | |
parent | f34af8f7d1a6182468ef72637dfab076b4d569ab (diff) |
#3405 MotD dynamic resizing
-rw-r--r-- | indra/newview/llprogressview.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llprogressview.h | 7 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_progress.xml | 18 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/pl/panel_progress.xml | 4 |
4 files changed, 37 insertions, 11 deletions
diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index f207b19593..2c09943b83 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -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"); @@ -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); @@ -309,6 +316,18 @@ void LLProgressView::setMessage(const std::string& msg) { mMessage = msg; mMessageText->setValue(mMessage); + S32 height = mMessageText->getTextPixelHeight(); + S32 delta = height - mMessageTextRectInitial.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) diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index a630c4a273..250ee511d7 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -93,6 +93,13 @@ protected: 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; diff --git a/indra/newview/skins/default/xui/en/panel_progress.xml b/indra/newview/skins/default/xui/en/panel_progress.xml index 337335e1aa..6b19907372 100644 --- a/indra/newview/skins/default/xui/en/panel_progress.xml +++ b/indra/newview/skins/default/xui/en/panel_progress.xml @@ -33,7 +33,7 @@ layout="topleft" left="0" orientation="vertical" - name="vertical_centering" + name="vertical_centering1" top="0" width="670"> <layout_panel @@ -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"> @@ -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 @@ -124,7 +124,7 @@ font_shadow="none" halign="left" valign="center" - height="100" + height="80" layout="topleft" left="45" line_spacing.pixels="2" diff --git a/indra/newview/skins/default/xui/pl/panel_progress.xml b/indra/newview/skins/default/xui/pl/panel_progress.xml index 125cb91bdb..8da982cc3f 100644 --- a/indra/newview/skins/default/xui/pl/panel_progress.xml +++ b/indra/newview/skins/default/xui/pl/panel_progress.xml @@ -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> |