making profiles look nicer when display names isn't on

meow-7.2.2
Leyla Farazha 2010-10-13 15:39:16 -07:00
parent 84f06e40e1
commit 330ea83c3d
4 changed files with 71 additions and 19 deletions

View File

@ -212,6 +212,8 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key)
getChild<LLUICtrl>("display_name_label")->setVisible( true );
getChild<LLUICtrl>("set_name")->setVisible( true );
getChild<LLUICtrl>("set_name")->setEnabled( true );
getChild<LLUICtrl>("solo_user_name")->setVisible( false );
getChild<LLUICtrl>("solo_username_label")->setVisible( false );
}
else
{
@ -220,6 +222,8 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key)
getChild<LLUICtrl>("display_name_label")->setVisible( false );
getChild<LLUICtrl>("set_name")->setVisible( false );
getChild<LLUICtrl>("set_name")->setEnabled( false );
getChild<LLUICtrl>("solo_user_name")->setVisible( true );
getChild<LLUICtrl>("solo_username_label")->setVisible( true );
}
}
@ -270,18 +274,8 @@ 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 );
getChild<LLUICtrl>("solo_user_name")->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 );
}
if (LLAvatarNameCache::useDisplayNames())
{
@ -290,6 +284,21 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam
getChild<LLUICtrl>("display_name_label")->setVisible( true );
getChild<LLUICtrl>("set_name")->setVisible( true );
getChild<LLUICtrl>("set_name")->setEnabled( true );
getChild<LLUICtrl>("solo_user_name")->setVisible( false );
getChild<LLUICtrl>("solo_username_label")->setVisible( false );
// 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 );
}
}
else
{
@ -298,6 +307,11 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam
getChild<LLUICtrl>("display_name_label")->setVisible( false );
getChild<LLUICtrl>("set_name")->setVisible( false );
getChild<LLUICtrl>("set_name")->setEnabled( false );
getChild<LLUICtrl>("solo_user_name")->setVisible( true );
getChild<LLUICtrl>("user_name_small")->setVisible( false );
getChild<LLUICtrl>("user_name")->setVisible( false );
getChild<LLUICtrl>("solo_username_label")->setVisible( true );
}
}
@ -351,6 +365,8 @@ void LLPanelMyProfileEdit::resetData()
//childSetTextArg("name_text", "[LAST]", LLStringUtil::null);
getChild<LLUICtrl>("user_name")->setValue( LLSD() );
getChild<LLUICtrl>("user_slid")->setValue( LLSD() );
getChild<LLUICtrl>("solo_user_name")->setValue( LLSD() );
getChild<LLUICtrl>("user_name_small")->setValue( LLSD() );
}
void LLPanelMyProfileEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl)

View File

@ -222,7 +222,6 @@ void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id,
{
getChild<LLUICtrl>("user_name_small")->setVisible( false );
getChild<LLUICtrl>("user_name")->setVisible( true );
}
if (LLAvatarNameCache::useDisplayNames())
@ -232,6 +231,7 @@ void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id,
getChild<LLUICtrl>("display_name_label")->setVisible( true );
getChild<LLUICtrl>("copy_to_clipboard")->setVisible( true );
getChild<LLUICtrl>("copy_to_clipboard")->setEnabled( true );
getChild<LLUICtrl>("solo_username_label")->setVisible( false );
}
else
{
@ -240,6 +240,7 @@ void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id,
getChild<LLUICtrl>("display_name_label")->setVisible( false );
getChild<LLUICtrl>("copy_to_clipboard")->setVisible( false );
getChild<LLUICtrl>("copy_to_clipboard")->setEnabled( false );
getChild<LLUICtrl>("solo_username_label")->setVisible( true );
}
}

View File

@ -96,6 +96,17 @@
name="display_name_label"
text_color="LtGray"
value="Display Name:"
width="80" />
<text
top="5"
follows="top|left"
height="13"
layout="topleft"
left="10"
name="solo_username_label"
text_color="LtGray"
value="Username:"
visible="false"
width="80" />
<button
name="set_name"
@ -112,13 +123,26 @@
font="SansSerifBigBold"
height="20"
layout="topleft"
left_pad="10"
name="user_name"
left="10"
name="solo_user_name"
text_color="white"
top_delta="3"
value="Hamilton Hitchings"
use_ellipses="true"
visible="true"
use_ellipses="true"
visible="false"
width="275" />
<text
follows="top|left"
font="SansSerifBigBold"
height="20"
layout="topleft"
left="43"
name="user_name"
text_color="white"
top_delta="0"
value="Hamilton Hitchings"
use_ellipses="true"
visible="true"
width="250" />
<text
follows="top|left"
@ -131,7 +155,7 @@
top_delta="-4"
value="Hamilton Hitchings"
use_ellipses="true"
visible="false"
visible="false"
wrap="true"
width="245" />
<text
@ -141,7 +165,7 @@
left="10"
name="user_label"
text_color="LtGray"
top_pad="8"
top_pad="8"
value="Username:"
width="70" />
<text

View File

@ -38,6 +38,17 @@
text_color="LtGray"
value="Display Name:"
width="80" />
<text
top_delta="0"
follows="top|left"
height="13"
layout="topleft"
left="45"
name="solo_username_label"
text_color="LtGray"
value="Username:"
visible="false"
width="80" />
<text
follows="top|right"
halign="right"
@ -108,7 +119,7 @@
top_delta="-2"
use_ellipses="true"
value="jack.linden"
width="205"
width="195"
wrap="true "/>
<tab_container
follows="all"