diff options
-rw-r--r-- | indra/newview/llchathistory.cpp | 44 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_login.xml | 6 |
2 files changed, 38 insertions, 12 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 6d98afbc58..a196b4c750 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -106,6 +106,18 @@ LLObjectIMHandler gObjectIMHandler; class LLChatHistoryHeader: public LLPanel { public: + LLChatHistoryHeader() + : LLPanel(), + mPopupMenuHandleAvatar(), + mPopupMenuHandleObject(), + mAvatarID(), + mSourceType(CHAT_SOURCE_UNKNOWN), + mFrom(), + mSessionID(), + mMinUserNameWidth(0), + mUserNameFont(NULL) + {} + static LLChatHistoryHeader* createInstance(const std::string& file_name) { LLChatHistoryHeader* pInstance = new LLChatHistoryHeader; @@ -249,27 +261,29 @@ public: mSourceType = CHAT_SOURCE_SYSTEM; } - LLTextBox* userName = getChild<LLTextBox>("user_name"); - - userName->setReadOnlyColor(style_params.readonly_color()); - userName->setColor(style_params.color()); + mUserNameFont = style_params.font(); + LLTextBox* user_name = getChild<LLTextBox>("user_name"); + user_name->setReadOnlyColor(style_params.readonly_color()); + user_name->setColor(style_params.color()); if (chat.mFromName.empty() || mSourceType == CHAT_SOURCE_SYSTEM || mAvatarID.isNull()) { mFrom = LLTrans::getString("SECOND_LIFE"); - userName->setValue(mFrom); + user_name->setValue(mFrom); + updateMinUserNameWidth(); } else { - // ...from a normal user, lookup the name and fill in later + // ...from a normal user, lookup the name and fill in later, + // but start with blank so sample data from XUI XML doesn't + // flash on the screen + user_name->setValue( LLSD() ); LLAvatarNameCache::get(mAvatarID, boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2)); } - mMinUserNameWidth = style_params.font()->getWidth(userName->getWText().c_str()) + PADDING; - setTimeField(chat); LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); @@ -323,15 +337,26 @@ public: LLPanel::draw(); } + void updateMinUserNameWidth() + { + if (mUserNameFont) + { + LLTextBox* user_name = getChild<LLTextBox>("user_name"); + const LLWString& text = user_name->getWText(); + mMinUserNameWidth = mUserNameFont->getWidth(text.c_str()) + PADDING; + } + } + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { mFrom = av_name.mDisplayName; LLTextBox* user_name = getChild<LLTextBox>("user_name"); user_name->setValue( LLSD(av_name.mDisplayName ) ); - user_name->setToolTip( av_name.mUsername ); setToolTip( av_name.mUsername ); + // name might have changed, update width + updateMinUserNameWidth(); } protected: @@ -450,6 +475,7 @@ protected: LLUUID mSessionID; S32 mMinUserNameWidth; + const LLFontGL* mUserNameFont; }; LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL; diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 88c264c649..14759ad731 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -65,13 +65,13 @@ Username: <line_editor follows="left|bottom" height="22" -label="bobsmith12 or Stellar Sunshine" +label="bobsmith12 or Steller Sunshine" left_delta="0" max_length="63" name="username_edit" prevalidate_callback="ascii" select_on_focus="true" -tool_tip="[SECOND_LIFE] ID, like bobsmith12 or Stellar Sunshine" +tool_tip="The username you chose when you registered, like bobsmith12 or Steller Sunshine" top_pad="0" width="150" /> <text @@ -186,7 +186,7 @@ name="forgot_password_text" top_pad="12" right="-10" width="180"> - Forgot your name or password? + Forgot your username or password? </text> <text follows="right|bottom" |