summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2012-09-21 15:27:46 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2012-09-21 15:27:46 -0700
commit6dd2bf36c52fa00732ed5a3910539f38c91ff173 (patch)
tree7d08f8e4ddc17b5e2a37a0b3302e6cd69aec9364 /indra
parent59a6a23ee0a94a7695679ea8df93bc0c60682262 (diff)
CHUI-283: Now the speaker/info icon positions are set based upon visibility.'
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llconversationview.cpp23
-rwxr-xr-xindra/newview/llconversationview.h2
-rwxr-xr-xindra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml2
3 files changed, 22 insertions, 5 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 6860415377..26d618e1b3 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -366,7 +366,7 @@ BOOL LLConversationViewParticipant::postBuild()
sStaticInitialized = true;
}
- computeLabelRightPadding();
+ updateChildren();
return LLFolderViewItem::postBuild();
}
@@ -432,14 +432,14 @@ void LLConversationViewParticipant::onInfoBtnClick()
void LLConversationViewParticipant::onMouseEnter(S32 x, S32 y, MASK mask)
{
mInfoBtn->setVisible(true);
- computeLabelRightPadding();
+ updateChildren();
LLFolderViewItem::onMouseEnter(x, y, mask);
}
void LLConversationViewParticipant::onMouseLeave(S32 x, S32 y, MASK mask)
{
mInfoBtn->setVisible(false);
- computeLabelRightPadding();
+ updateChildren();
LLFolderViewItem::onMouseEnter(x, y, mask);
}
@@ -463,12 +463,14 @@ void LLConversationViewParticipant::initChildrenWidths(LLConversationViewPartici
llassert(index == 0);
}
-void LLConversationViewParticipant::computeLabelRightPadding()
+void LLConversationViewParticipant::updateChildren()
{
mLabelPaddingRight = DEFAULT_LABEL_PADDING_RIGHT;
LLView* control;
S32 ctrl_width;
+ LLRect controlRect;
+ //Cycles through controls starting from right to left
for (S32 i = 0; i < ALIC_COUNT; ++i)
{
control = getItemChildView((EAvatarListItemChildIndex)i);
@@ -476,9 +478,22 @@ void LLConversationViewParticipant::computeLabelRightPadding()
// skip invisible views
if (!control->getVisible()) continue;
+ //Get current pos/dimensions
+ controlRect = control->getRect();
+
ctrl_width = sChildrenWidths[i]; // including space between current & left controls
// accumulate the amount of space taken by the controls
mLabelPaddingRight += ctrl_width;
+
+ //Reposition visible controls in case adjacent controls to the right are hidden.
+ controlRect.setLeftTopAndSize(
+ getLocalRect().getWidth() - mLabelPaddingRight,
+ controlRect.mTop,
+ controlRect.getWidth(),
+ controlRect.getHeight());
+
+ //Sets the new position
+ control->setShape(controlRect);
}
}
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index 5bc4678b7b..0b98c34c73 100755
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -127,7 +127,7 @@ private:
static bool sStaticInitialized; // this variable is introduced to improve code readability
static S32 sChildrenWidths[ALIC_COUNT];
static void initChildrenWidths(LLConversationViewParticipant* self);
- void computeLabelRightPadding();
+ void updateChildren();
LLView* getItemChildView(EAvatarListItemChildIndex child_view_index);
};
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 a28d6e0209..0024decd4c 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
@@ -19,7 +19,9 @@
follows="left"
height="20"
default_icon_name="Generic_Person"
+ layout="topleft"
left="50"
+ top="2"
width="20" />
<info_button
follows="right"