summaryrefslogtreecommitdiff
path: root/indra/newview/llinspectavatar.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2010-08-13 17:33:04 -0700
committerLeyla Farazha <leyla@lindenlab.com>2010-08-13 17:33:04 -0700
commitbc60707968bd8b2cd2941357a6ff653f6ed2d40e (patch)
treed1d0dd93f3c8eab2cb063e16ce0d228ed44c7482 /indra/newview/llinspectavatar.cpp
parent9bb2c74dc59073db5ad91e1053f9bd04836b4ce8 (diff)
DEV-52163 Long display name with wide characters not fully visible in viewer aside from nametag
Diffstat (limited to 'indra/newview/llinspectavatar.cpp')
-rw-r--r--indra/newview/llinspectavatar.cpp17
1 files changed, 17 insertions, 0 deletions
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<LLUICtrl>("user_name")->setValue("");
+ getChild<LLUICtrl>("user_name_small")->setValue("");
getChild<LLUICtrl>("user_slid")->setValue("");
getChild<LLUICtrl>("user_subtitle")->setValue("");
getChild<LLUICtrl>("user_details")->setValue("");
@@ -617,8 +619,23 @@ void LLInspectAvatar::onAvatarNameCache(
if (agent_id == mAvatarID)
{
getChild<LLUICtrl>("user_name")->setValue(av_name.mDisplayName);
+ getChild<LLUICtrl>("user_name_small")->setValue(av_name.mDisplayName);
getChild<LLUICtrl>("user_slid")->setValue(av_name.mUsername);
mAvatarName = av_name;
+
+ // 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 );
+
+ }
+
}
}