From bc60707968bd8b2cd2941357a6ff653f6ed2d40e Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 13 Aug 2010 17:33:04 -0700 Subject: DEV-52163 Long display name with wide characters not fully visible in viewer aside from nametag --- indra/newview/llinspectavatar.cpp | 17 +++++++++++ indra/newview/llpanelprofileview.cpp | 15 ++++++++++ .../skins/default/xui/en/inspect_avatar.xml | 35 +++++++++++++++------- .../skins/default/xui/en/panel_profile_view.xml | 30 +++++++++++++------ .../skins/default/xui/en/widgets/inspector.xml | 1 + 5 files changed, 78 insertions(+), 20 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 1cd1dcc7f0..77435ae214 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -58,6 +58,7 @@ #include "llfloater.h" #include "llfloaterreg.h" #include "llmenubutton.h" +#include "lltextbox.h" #include "lltooltip.h" // positionViewNearMouse() #include "lltrans.h" #include "lluictrl.h" @@ -333,6 +334,7 @@ void LLInspectAvatar::requestUpdate() // Clear out old data so it doesn't flash between old and new getChild("user_name")->setValue(""); + getChild("user_name_small")->setValue(""); getChild("user_slid")->setValue(""); getChild("user_subtitle")->setValue(""); getChild("user_details")->setValue(""); @@ -617,8 +619,23 @@ void LLInspectAvatar::onAvatarNameCache( if (agent_id == mAvatarID) { getChild("user_name")->setValue(av_name.mDisplayName); + getChild("user_name_small")->setValue(av_name.mDisplayName); getChild("user_slid")->setValue(av_name.mUsername); mAvatarName = av_name; + + // 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 ); + + } + } } diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index d22d8d2718..ab235f2b75 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -207,7 +207,22 @@ void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { getChild("user_name")->setValue( av_name.mDisplayName ); + getChild("user_name_small")->setValue( av_name.mDisplayName ); getChild("user_slid")->setValue( av_name.mUsername ); + + // 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 ); + + } + } // EOF diff --git a/indra/newview/skins/default/xui/en/inspect_avatar.xml b/indra/newview/skins/default/xui/en/inspect_avatar.xml index d018ea7ce1..b2efd13441 100644 --- a/indra/newview/skins/default/xui/en/inspect_avatar.xml +++ b/indra/newview/skins/default/xui/en/inspect_avatar.xml @@ -15,7 +15,7 @@ single_instance="true" sound_flags="0" visible="true" - width="228"> + width="245">