From 7a43f0983d6906efcea56370e927912461ab898b Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 29 Sep 2010 14:26:01 -0700 Subject: edit profile display name now sizes down if too long --- indra/newview/llpanelme.cpp | 14 ++++++++++++++ .../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("user_name")->setValue( av_name.mDisplayName ); getChild("user_slid")->setValue( av_name.mUsername ); + getChild("user_name_small")->setValue( av_name.mDisplayName ); + + // show smaller display name if too long to display in regular size + if (getChild("user_name")->getTextPixelWidth() > getChild("user_name")->getRect().getWidth()) + { + getChild("user_name_small")->setVisible( true ); + getChild("user_name")->setVisible( false ); + } + else + { + getChild("user_name_small")->setVisible( false ); + getChild("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" /> +