CHUI-283: Now the speaker/info icon positions are set based upon visibility.'
parent
59a6a23ee0
commit
6dd2bf36c5
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue