summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llchathistory.cpp28
-rw-r--r--indra/newview/skins/default/xui/en/panel_chat_header.xml4
2 files changed, 26 insertions, 6 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 422aae3c25..dbb8e0fef4 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -202,10 +202,8 @@ public:
userName->setValue(SL);
}
+ setTimeField(chat.mTimeStr);
- LLTextBox* timeBox = getChild<LLTextBox>("time_box");
- timeBox->setValue(chat.mTimeStr);
-
LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon");
if(mSourceType != CHAT_SOURCE_AGENT)
@@ -271,7 +269,29 @@ protected:
}
}
-
+private:
+ void setTimeField(const std::string& time_value)
+ {
+ LLTextBox* time_box = getChild<LLTextBox>("time_box");
+
+ LLRect rect_before = time_box->getRect();
+ time_box->setValue(time_value);
+
+ // set necessary textbox width to fit all text
+ time_box->reshapeToFitText();
+ LLRect rect_after = time_box->getRect();
+
+ // move rect to the left to correct position...
+ llinfos << "WWW: " << rect_before << rect_after << llendl;
+ S32 delta_pos_x = rect_before.getWidth() - rect_after.getWidth();
+ S32 delta_pos_y = rect_before.getHeight() - rect_after.getHeight();
+ time_box->translate(delta_pos_x, delta_pos_y);
+
+ //... & change width of the name control
+ LLTextBox* user_name = getChild<LLTextBox>("user_name");
+ const LLRect& user_rect = user_name->getRect();
+ user_name->reshape(user_rect.getWidth() + delta_pos_x, user_rect.getHeight());
+ }
protected:
LLHandle<LLView> mPopupMenuHandleAvatar;
diff --git a/indra/newview/skins/default/xui/en/panel_chat_header.xml b/indra/newview/skins/default/xui/en/panel_chat_header.xml
index 7a3eae35a9..96e5b4d413 100644
--- a/indra/newview/skins/default/xui/en/panel_chat_header.xml
+++ b/indra/newview/skins/default/xui/en/panel_chat_header.xml
@@ -25,7 +25,7 @@
height="12"
layout="topleft"
left_pad="5"
- right="-50"
+ right="-60"
name="user_name"
text_color="white"
top="8"
@@ -39,7 +39,7 @@
layout="topleft"
left_pad="5"
name="time_box"
- right="-10"
+ right="-5"
top="8"
value="23:30"
width="50" />