diff options
author | Steve Bennetts <steve@lindenlab.com> | 2009-11-24 12:42:14 -0800 |
---|---|---|
committer | Steve Bennetts <steve@lindenlab.com> | 2009-11-24 12:42:14 -0800 |
commit | 9e2d78aca1fa96e96b4b324cabfb0efeb26f7397 (patch) | |
tree | 042a161e9bc2608d0098b2ea745178384f466362 /indra/newview/llchathistory.cpp | |
parent | f9081220accfe5c197f1c567af8806bde236f946 (diff) | |
parent | 04cf3fefca230f4f2c351dddebb36e691a9f7bc5 (diff) |
Merge from product-engine
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r-- | indra/newview/llchathistory.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index cd0456b308..2c9b38b82a 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -199,10 +199,8 @@ public: userName->setValue(SL); } + setTimeField(chat.mTimeStr); - LLUICtrl* timeBox = getChild<LLUICtrl>("time_box"); - timeBox->setValue(chat.mTimeStr); - LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); if(mSourceType != CHAT_SOURCE_AGENT) @@ -268,7 +266,28 @@ 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... + 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; |