summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2009-11-24 13:20:31 +0200
committerMike Antipov <mantipov@productengine.com>2009-11-24 13:20:31 +0200
commit67ef3059b5a0084c6e501ae088cedf79d97f4277 (patch)
tree7a3b099353c65a985787bee3877b818bfca5874e /indra/newview/llchathistory.cpp
parent0ef5b128aa4076be7cad424337d52ca5577aebdf (diff)
Work on critical sub-task EXT-2615 (IM Chat History is severely broken)
-- Implemented fitting of the timestamp in Chat History header panel depend on time string width --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r--indra/newview/llchathistory.cpp28
1 files changed, 24 insertions, 4 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;