diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-05-06 17:53:18 -0700 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-05-06 17:53:18 -0700 |
commit | 04587bdb9d5e1653d5b19a6ca51e547180994958 (patch) | |
tree | e4054254fe7e1b6765644124741450a6819ff356 | |
parent | c451672ee7e3bc8229a3e5cba544c93495147024 (diff) |
ACME-340 Get facebook icon from spec and add to viewer: Added a facebook icon and the icon appears only for the 'Invite people you know to SL' tab.
-rw-r--r-- | indra/newview/llpersontabview.cpp | 33 | ||||
-rw-r--r-- | indra/newview/llpersontabview.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/textures/icons/Facebook.png | bin | 0 -> 365 bytes | |||
-rw-r--r-- | indra/newview/skins/default/textures/textures.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/person_view.xml | 12 |
5 files changed, 47 insertions, 2 deletions
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 0dfd53705b..6aa51febcb 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -125,6 +125,7 @@ bool LLPersonView::sChildrenWidthsInitialized = false; ChildWidthVec LLPersonView::mChildWidthVec; LLPersonView::Params::Params() : +facebook_icon("facebook_icon"), avatar_icon("avatar_icon"), last_interaction_time_textbox("last_interaction_time_textbox"), permission_edit_theirs_icon("permission_edit_theirs_icon"), @@ -140,6 +141,7 @@ LLPersonView::LLPersonView(const LLPersonView::Params& p) : LLFolderViewItem(p), mImageOver(LLUI::getUIImage("ListItem_Over")), mImageSelected(LLUI::getUIImage("ListItem_Select")), +mFacebookIcon(NULL), mAvatarIcon(NULL), mLastInteractionTimeTextbox(NULL), mPermissionEditTheirsIcon(NULL), @@ -154,7 +156,19 @@ mOutputMonitorCtrl(NULL) S32 LLPersonView::getLabelXPos() { - return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; + S32 label_x_pos; + + if(mAvatarIcon->getVisible()) + { + label_x_pos = getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; + } + else + { + label_x_pos = getIndentation() + mFacebookIcon->getRect().getWidth() + mIconPad; + } + + + return label_x_pos; } void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) @@ -164,6 +178,16 @@ void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) person_folder_view->requestArrange(); mPersonTabModel = static_cast<LLPersonTabModel *>(getParentFolder()->getViewModelItem()); + + if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) + { + mAvatarIcon->setVisible(TRUE); + } + else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND) + { + mFacebookIcon->setVisible(TRUE); + } + } LLPersonView::~LLPersonView() @@ -295,11 +319,16 @@ void LLPersonView::drawHighlight() void LLPersonView::initFromParams(const LLPersonView::Params & params) { + LLIconCtrl::Params facebook_icon_params(params.facebook_icon()); + applyXUILayout(facebook_icon_params, this); + mFacebookIcon = LLUICtrlFactory::create<LLIconCtrl>(facebook_icon_params); + addChild(mFacebookIcon); + LLAvatarIconCtrl::Params avatar_icon_params(params.avatar_icon()); applyXUILayout(avatar_icon_params, this); mAvatarIcon = LLUICtrlFactory::create<LLAvatarIconCtrl>(avatar_icon_params); addChild(mAvatarIcon); - + LLTextBox::Params last_interaction_time_textbox(params.last_interaction_time_textbox()); applyXUILayout(last_interaction_time_textbox, this); mLastInteractionTimeTextbox = LLUICtrlFactory::create<LLTextBox>(last_interaction_time_textbox); diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 9e5fdc3057..9839a1eaaf 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -77,6 +77,7 @@ public: struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params> { Params(); + Optional<LLIconCtrl::Params> facebook_icon; Optional<LLAvatarIconCtrl::Params> avatar_icon; Optional<LLTextBox::Params> last_interaction_time_textbox; Optional<LLIconCtrl::Params> permission_edit_theirs_icon; @@ -111,6 +112,7 @@ private: LLPointer<LLUIImage> mImageOver; LLPointer<LLUIImage> mImageSelected; + LLIconCtrl * mFacebookIcon; LLAvatarIconCtrl* mAvatarIcon; LLTextBox * mLastInteractionTimeTextbox; LLIconCtrl * mPermissionEditTheirsIcon; diff --git a/indra/newview/skins/default/textures/icons/Facebook.png b/indra/newview/skins/default/textures/icons/Facebook.png Binary files differnew file mode 100644 index 0000000000..8287d56f88 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Facebook.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 5b17ef94db..18146943a5 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -199,6 +199,8 @@ with the same filename but different name <texture name="ExternalBrowser_Off" file_name="icons/ExternalBrowser_Off.png" preload="false" /> <texture name="Edit_Wrench" file_name="icons/Edit_Wrench.png" preload="false" /> + <texture name="Facebook_Icon" file_name="icons/Facebook.png" preload="false" /> + <texture name="Favorite_Star_Active" file_name="navbar/Favorite_Star_Active.png" preload="false" /> <texture name="Favorite_Star_Off" file_name="navbar/Favorite_Star_Off.png" preload="false" /> <texture name="Favorite_Star_Press" file_name="navbar/Favorite_Star_Press.png" preload="false" /> 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 4a39109f36..006437401c 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -13,6 +13,17 @@ text_pad_right="4" arrow_size="10" max_folder_item_overlap="2"> + <facebook_icon + layout="topleft" + follows="left" + height="16" + image_name="Facebook_Icon" + left="5" + top="5" + name="facebook_icon" + tool_tip="Facebook User" + visible="false" + width="16" /> <avatar_icon follows="left" layout="topleft" @@ -20,6 +31,7 @@ default_icon_name="Generic_Person" left="5" top="2" + visible="false" width="20" /> <last_interaction_time_textbox layout="topleft" |