diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-04-29 10:59:09 -0700 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-04-29 10:59:09 -0700 |
commit | 59880225108ef807ef58ed98357f0706c045ff61 (patch) | |
tree | 40ee56bce7e8995eb2eb192bd80f45416de3701e /indra | |
parent | 5f580d11d92bffafd3c2183b657347283a9d1e8f (diff) |
ACME-252 Create AvatarFolderItemView: Now the avatar icon will display but it is not yet functional
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llpersontabview.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llpersontabview.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/person_view.xml | 14 |
4 files changed, 30 insertions, 6 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 12d8f6b83a..ef45cc44f7 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -755,7 +755,7 @@ BOOL LLPanelPeople::postBuild() mPersonFolderView->setScrollContainer(scroller); mPersonFolderView->setFollowsAll(); - //Create a session + //Create a person tab LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel); LLPersonTabView::Params params; params.name = item->getDisplayName(); @@ -768,7 +768,7 @@ BOOL LLPanelPeople::postBuild() mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; - //Create a session + //Create a person tab item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel); params.name = item->getDisplayName(); params.root = mPersonFolderView; diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 3093ff9015..e0bda32308 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -116,20 +116,22 @@ void LLPersonTabView::drawHighlight() static LLDefaultChildRegistry::Register<LLPersonView> r_person_view("person_view"); -LLPersonView::Params::Params() +LLPersonView::Params::Params() : +avatar_icon("avatar_icon") {} LLPersonView::LLPersonView(const LLPersonView::Params& p) : LLFolderViewItem(p), mImageOver(LLUI::getUIImage("ListItem_Over")), -mImageSelected(LLUI::getUIImage("ListItem_Select")) +mImageSelected(LLUI::getUIImage("ListItem_Select")), +mAvatarIcon(NULL) { } S32 LLPersonView::getLabelXPos() { - return getIndentation(); + return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; } void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) @@ -186,3 +188,11 @@ void LLPersonView::drawHighlight() mImageOver->draw(x, y, width, height); } } + +void LLPersonView::initFromParams(const LLPersonView::Params & params) +{ + LLAvatarIconCtrl::Params avatar_icon_params(params.avatar_icon()); + applyXUILayout(avatar_icon_params, this); + mAvatarIcon = LLUICtrlFactory::create<LLAvatarIconCtrl>(avatar_icon_params); + addChild(mAvatarIcon); +} diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index b246be288a..e1b34e1da4 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -69,6 +69,7 @@ public: struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params> { Params(); + Optional<LLAvatarIconCtrl::Params> avatar_icon; }; LLPersonView(const LLPersonView::Params& p); @@ -76,6 +77,7 @@ public: S32 getLabelXPos(); void addToFolder(LLFolderViewFolder * person_folder_view); + void initFromParams(const LLPersonView::Params & params); protected: void draw(); diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index 13aa26959f..84ad807b83 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -6,8 +6,20 @@ item_top_pad="3" mouse_opaque="true" follows="left|top|right" + icon_pad="4" + icon_width="20" text_pad="6" text_pad_left="4" text_pad_right="4" arrow_size="10" - max_folder_item_overlap="2"/> + max_folder_item_overlap="2"> + <avatar_icon + follows="left" + layout="topleft" + height="20" + default_icon_name="Generic_Person" + left="5" + top="2" + width="20" /> + </person_view> + |