DEV-52163 Long display name with wide characters not fully visible in viewer aside from nametag

meow-7.2.2
Leyla Farazha 2010-08-13 17:33:04 -07:00
parent 9bb2c74dc5
commit bc60707968
5 changed files with 78 additions and 20 deletions

View File

@ -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 );
}
}
}

View File

@ -207,7 +207,22 @@ void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name)
{
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 );
// 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 );
}
}
// EOF

View File

@ -15,7 +15,7 @@
single_instance="true"
sound_flags="0"
visible="true"
width="228">
width="245">
<!-- Allowed fields include:
[BORN_ON] ("12/3/2008")
[SL_PROFILE] (Second Life profile),
@ -34,16 +34,29 @@
</string>
<text
follows="top|left"
font="SansSerifLarge"
height="16"
font="SansSerif"
height="20"
left="8"
name="user_name"
top="10"
name="user_name_small"
top="7"
text_color="White"
use_ellipses="true"
value="Grumpity ProductEngine"
width="175" />
<text
word_wrap="true"
value="Grumpity ProductEngine with a long name"
width="185" />
<text
follows="top|left"
font="SansSerifBigLarge"
height="21"
left="8"
name="user_name"
top="10"
text_color="White"
use_ellipses="true"
visible="false"
value="Grumpity ProductEngine"
width="190" />
<text
follows="top|left"
height="16"
left="8"
@ -71,9 +84,9 @@
name="user_details"
right="-10"
word_wrap="true"
top_pad="6"
top_pad="4"
use_ellipses="true"
width="220">This is my second life description and I really think it is great.
width="220">This is my second life description and I really think it is great. But for some reason my description is super extra long because I like to talk a whole lot
</text>
<slider
follows="top|left"
@ -87,7 +100,7 @@
tool_tip="Voice volume"
top_pad="0"
value="0.5"
width="195" />
width="200" />
<button
follows="top|left"
height="16"

View File

@ -28,17 +28,30 @@
tab_stop="false"
top="2"
width="30" />
<text_editor
<text
h_pad="0"
v_pad="0"
allow_scroll="false"
bg_visible="false"
read_only = "true"
follows="top|left|right"
font="SansSerifHugeBold"
height="26"
font="SansSerifBigBold"
height="29"
layout="topleft"
left_pad="5"
name="user_name_small"
text_color="LtGray"
top="0"
value="(Loading...)"
use_ellipses="true"
word_wrap="true"
visible="false"
width="275" />
<text
h_pad="0"
v_pad="0"
follows="top|left|right"
font="SansSerifHugeBold"
height="27"
layout="topleft"
left_delta="0"
name="user_name"
text_color="LtGray"
top="2"
@ -52,7 +65,6 @@
left="45"
name="user_slid"
text_color="LtGray"
value=""
width="150" />
<text
follows="top|left"
@ -67,7 +79,7 @@
width="150" />
<tab_container
follows="all"
height="538"
height="537"
halign="center"
layout="topleft"
left="5"
@ -77,7 +89,7 @@
tab_height="30"
tab_position="top"
top_pad="5"
width="317">
width="317">
<panel
class="panel_profile"
filename="panel_profile.xml"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<inspector name="inspector"
max_width="300"
bg_opaque_color="DkGray_66"
background_visible="true"
bg_opaque_image="Inspector_Hover"