From 330ea83c3dd8f56f4cef56481f951b705d28f027 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 13 Oct 2010 15:39:16 -0700 Subject: making profiles look nicer when display names isn't on --- indra/newview/llpanelme.cpp | 38 +++++++++++++++------- indra/newview/llpanelprofileview.cpp | 3 +- .../skins/default/xui/en/panel_edit_profile.xml | 36 ++++++++++++++++---- .../skins/default/xui/en/panel_profile_view.xml | 13 +++++++- 4 files changed, 71 insertions(+), 19 deletions(-) diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index a9f7b6c62c..5ea94e0611 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -212,6 +212,8 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) getChild("display_name_label")->setVisible( true ); getChild("set_name")->setVisible( true ); getChild("set_name")->setEnabled( true ); + getChild("solo_user_name")->setVisible( false ); + getChild("solo_username_label")->setVisible( false ); } else { @@ -220,6 +222,8 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) getChild("display_name_label")->setVisible( false ); getChild("set_name")->setVisible( false ); getChild("set_name")->setEnabled( false ); + getChild("solo_user_name")->setVisible( true ); + getChild("solo_username_label")->setVisible( true ); } } @@ -270,18 +274,8 @@ 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 ); + getChild("solo_user_name")->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 ); - } if (LLAvatarNameCache::useDisplayNames()) { @@ -290,6 +284,21 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam getChild("display_name_label")->setVisible( true ); getChild("set_name")->setVisible( true ); getChild("set_name")->setEnabled( true ); + + getChild("solo_user_name")->setVisible( false ); + getChild("solo_username_label")->setVisible( false ); + + // 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 ); + } } else { @@ -298,6 +307,11 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam getChild("display_name_label")->setVisible( false ); getChild("set_name")->setVisible( false ); getChild("set_name")->setEnabled( false ); + + getChild("solo_user_name")->setVisible( true ); + getChild("user_name_small")->setVisible( false ); + getChild("user_name")->setVisible( false ); + getChild("solo_username_label")->setVisible( true ); } } @@ -351,6 +365,8 @@ void LLPanelMyProfileEdit::resetData() //childSetTextArg("name_text", "[LAST]", LLStringUtil::null); getChild("user_name")->setValue( LLSD() ); getChild("user_slid")->setValue( LLSD() ); + getChild("solo_user_name")->setValue( LLSD() ); + getChild("user_name_small")->setValue( LLSD() ); } void LLPanelMyProfileEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl) diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index 9011583a60..7635aedf58 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -222,7 +222,6 @@ void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id, { getChild("user_name_small")->setVisible( false ); getChild("user_name")->setVisible( true ); - } if (LLAvatarNameCache::useDisplayNames()) @@ -232,6 +231,7 @@ void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id, getChild("display_name_label")->setVisible( true ); getChild("copy_to_clipboard")->setVisible( true ); getChild("copy_to_clipboard")->setEnabled( true ); + getChild("solo_username_label")->setVisible( false ); } else { @@ -240,6 +240,7 @@ void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id, getChild("display_name_label")->setVisible( false ); getChild("copy_to_clipboard")->setVisible( false ); getChild("copy_to_clipboard")->setEnabled( false ); + getChild("solo_username_label")->setVisible( true ); } } 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 70c7bae662..90dbddaff7 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -96,6 +96,17 @@ name="display_name_label" text_color="LtGray" value="Display Name:" + width="80" /> +