From 9d9853082361b35987a70574b422c40e8ee04d93 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 30 Oct 2012 18:20:28 -0700 Subject: CHUI-471: Adjusted conversationview so that indentation of the avatar icon is dependent upon getIndentation() instead of modifying avatar icon's left value. --- indra/newview/llconversationview.cpp | 18 +++++++++++++++++- indra/newview/llconversationview.h | 1 + indra/newview/llimfloatercontainer.cpp | 6 ++---- .../xui/en/widgets/conversation_view_participant.xml | 2 -- 4 files changed, 20 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 3082284991..81212a9141 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -432,6 +432,22 @@ void LLConversationViewParticipant::draw() LLView::draw(); } +// virtual +S32 LLConversationViewParticipant::arrange(S32* width, S32* height) +{ + //Need to call arrange first since it computes value used in getIndentation() + S32 arranged = LLFolderViewItem::arrange(width, height); + + //Adjusts the avatar icon based upon the indentation + LLRect avatarRect(getIndentation(), + mAvatarIcon->getRect().mTop, + getIndentation() + mAvatarIcon->getRect().getWidth(), + mAvatarIcon->getRect().mBottom); + mAvatarIcon->setShape(avatarRect); + + return arranged; +} + void LLConversationViewParticipant::selectItem() { LLConversationItem* vmi = this->getParentFolder() ? static_cast(this->getParentFolder()->getViewModelItem()) : NULL; @@ -507,7 +523,7 @@ void LLConversationViewParticipant::onMouseLeave(S32 x, S32 y, MASK mask) S32 LLConversationViewParticipant::getLabelXPos() { - return mAvatarIcon->getRect().mRight + mIconPad; + return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; } // static diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index bd95387bbe..18cb9bdb27 100755 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -129,6 +129,7 @@ protected: void initFromParams(const Params& params); BOOL postBuild(); /*virtual*/ void draw(); + /*virtual*/ S32 arrange(S32* width, S32* height); void onInfoBtnClick(); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 01456fee3b..298a6055bf 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -1289,9 +1289,6 @@ LLConversationViewParticipant* LLIMFloaterContainer::createConversationViewParti LLRect panel_rect = mConversationsListPanel->getRect(); params.name = item->getDisplayName(); - //params.icon = bridge->getIcon(); - //params.icon_open = bridge->getOpenIcon(); - //params.creation_date = bridge->getCreationDate(); params.root = mConversationsRoot; params.listener = item; @@ -1299,7 +1296,8 @@ LLConversationViewParticipant* LLIMFloaterContainer::createConversationViewParti params.rect = LLRect (0, 24, panel_rect.getWidth(), 0); params.tool_tip = params.name; params.participant_id = item->getUUID(); - + params.folder_indentation = 42; + return LLUICtrlFactory::create(params); } diff --git a/indra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml b/indra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml index 0024decd4c..b83d9122f7 100755 --- a/indra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml +++ b/indra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml @@ -1,7 +1,6 @@