Skip to content
Snippets Groups Projects
Commit 75e609ff authored by Merov Linden's avatar Merov Linden
Browse files

STORM-293 : merge with viewer-development

parents 9d5678ae ea7420a7
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
bool LLAvatarListItem::sStaticInitialized = false; bool LLAvatarListItem::sStaticInitialized = false;
S32 LLAvatarListItem::sLeftPadding = 0; S32 LLAvatarListItem::sLeftPadding = 0;
S32 LLAvatarListItem::sRightNamePadding = 0; S32 LLAvatarListItem::sNameRightPadding = 0;
S32 LLAvatarListItem::sChildrenWidths[LLAvatarListItem::ALIC_COUNT]; S32 LLAvatarListItem::sChildrenWidths[LLAvatarListItem::ALIC_COUNT];
static LLWidgetNameRegistry::StaticRegistrar sRegisterAvatarListItemParams(&typeid(LLAvatarListItem::Params), "avatar_list_item"); static LLWidgetNameRegistry::StaticRegistrar sRegisterAvatarListItemParams(&typeid(LLAvatarListItem::Params), "avatar_list_item");
...@@ -52,7 +52,8 @@ LLAvatarListItem::Params::Params() ...@@ -52,7 +52,8 @@ LLAvatarListItem::Params::Params()
voice_call_joined_style("voice_call_joined_style"), voice_call_joined_style("voice_call_joined_style"),
voice_call_left_style("voice_call_left_style"), voice_call_left_style("voice_call_left_style"),
online_style("online_style"), online_style("online_style"),
offline_style("offline_style") offline_style("offline_style"),
name_right_pad("name_right_pad", 0)
{}; {};
...@@ -119,6 +120,9 @@ BOOL LLAvatarListItem::postBuild() ...@@ -119,6 +120,9 @@ BOOL LLAvatarListItem::postBuild()
// so that we can hide and show them again later. // so that we can hide and show them again later.
initChildrenWidths(this); initChildrenWidths(this);
// Right padding between avatar name text box and nearest visible child.
sNameRightPadding = LLUICtrlFactory::getDefaultParams<LLAvatarListItem>().name_right_pad;
sStaticInitialized = true; sStaticInitialized = true;
} }
...@@ -486,7 +490,6 @@ void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item) ...@@ -486,7 +490,6 @@ void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item)
S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft; S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft;
sLeftPadding = avatar_item->mAvatarIcon->getRect().mLeft; sLeftPadding = avatar_item->mAvatarIcon->getRect().mLeft;
sRightNamePadding = avatar_item->mLastInteractionTime->getRect().mLeft - avatar_item->mAvatarName->getRect().mRight;
S32 index = ALIC_COUNT; S32 index = ALIC_COUNT;
sChildrenWidths[--index] = icon_width; sChildrenWidths[--index] = icon_width;
...@@ -565,7 +568,7 @@ void LLAvatarListItem::updateChildren() ...@@ -565,7 +568,7 @@ void LLAvatarListItem::updateChildren()
// apply paddings // apply paddings
name_new_width -= sLeftPadding; name_new_width -= sLeftPadding;
name_new_width -= sRightNamePadding; name_new_width -= sNameRightPadding;
name_view_rect.setLeftTopAndSize( name_view_rect.setLeftTopAndSize(
name_new_left, name_new_left,
......
...@@ -51,6 +51,8 @@ class LLAvatarListItem : public LLPanel, public LLFriendObserver ...@@ -51,6 +51,8 @@ class LLAvatarListItem : public LLPanel, public LLFriendObserver
online_style, online_style,
offline_style; offline_style;
Optional<S32> name_right_pad;
Params(); Params();
}; };
...@@ -215,7 +217,7 @@ class LLAvatarListItem : public LLPanel, public LLFriendObserver ...@@ -215,7 +217,7 @@ class LLAvatarListItem : public LLPanel, public LLFriendObserver
static bool sStaticInitialized; // this variable is introduced to improve code readability static bool sStaticInitialized; // this variable is introduced to improve code readability
static S32 sLeftPadding; // padding to first left visible child (icon or name) static S32 sLeftPadding; // padding to first left visible child (icon or name)
static S32 sRightNamePadding; // right padding from name to next visible child static S32 sNameRightPadding; // right padding from name to next visible child
/** /**
* Contains widths of each child specified by EAvatarListItemChildIndex * Contains widths of each child specified by EAvatarListItemChildIndex
......
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<avatar_list_item <avatar_list_item
name_right_pad="5"
height="0" height="0"
layout="topleft" layout="topleft"
left="0" left="0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment