diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-09-29 14:26:01 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-09-29 14:26:01 -0700 |
commit | 7a43f0983d6906efcea56370e927912461ab898b (patch) | |
tree | 2df0293ffde86c9558836a0e97ff25eb2796ba41 /indra/newview | |
parent | 366b390a9be2b56e84c6cd5f85f5e2740d364cd1 (diff) |
edit profile display name now sizes down if too long
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelme.cpp | 14 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_edit_profile.xml | 19 |
2 files changed, 31 insertions, 2 deletions
diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index a4a63cdc1c..79d5195ccf 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -232,6 +232,20 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam { getChild<LLUICtrl>("user_name")->setValue( av_name.mDisplayName ); getChild<LLUICtrl>("user_slid")->setValue( av_name.mUsername ); + getChild<LLUICtrl>("user_name_small")->setValue( av_name.mDisplayName ); + + // show smaller display name if too long to display in regular size + if (getChild<LLTextBox>("user_name")->getTextPixelWidth() > getChild<LLTextBox>("user_name")->getRect().getWidth()) + { + getChild<LLUICtrl>("user_name_small")->setVisible( true ); + getChild<LLUICtrl>("user_name")->setVisible( false ); + } + else + { + getChild<LLUICtrl>("user_name_small")->setVisible( false ); + getChild<LLUICtrl>("user_name")->setVisible( true ); + + } } BOOL LLPanelMyProfileEdit::postBuild() diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index 665af93876..cf075b8aae 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -118,7 +118,22 @@ top_delta="3" value="Hamilton Hitchings" use_ellipses="true" - width="265" /> + visible="true" + width="250" /> + <text + follows="top|left" + font="SansSerifBold" + height="20" + layout="topleft" + left_delta="0" + name="user_name_small" + text_color="white" + top_delta="-4" + value="Hamilton Hitchings" + use_ellipses="true" + visible="false" + wrap="true" + width="245" /> <text follows="top|left" height="13" @@ -126,7 +141,7 @@ left="10" name="user_label" text_color="LtGray" - top_pad="4" + top_pad="8" value="Username:" width="70" /> <text |