summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-04-24 17:41:49 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2013-04-24 17:41:49 -0700
commit1787988c47921478598c5f47828f3dde8922ffa6 (patch)
tree4249700d2aa452ba3980d60ecd1ef2d1e9ea288b /indra
parent4921c654939d118cb4f9847512d6e3008c67428f (diff)
ACME-251 Create AvatarFolderItemView: Adding in code to make the persontab's function more like accordiontabs
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelpeople.cpp13
-rw-r--r--indra/newview/llpersonfolderview.cpp19
-rw-r--r--indra/newview/llpersonfolderview.h3
-rw-r--r--indra/newview/llpersontabview.cpp17
-rw-r--r--indra/newview/llpersontabview.h2
5 files changed, 50 insertions, 4 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 04881a12f1..16dc252946 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -753,7 +753,6 @@ BOOL LLPanelPeople::postBuild()
mConversationsRoot->setFollowsAll();
//Create a session
- //LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance();
LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel);
LLPersonTabView::Params params;
params.name = item->getDisplayName();
@@ -765,6 +764,18 @@ BOOL LLPanelPeople::postBuild()
mConversationsRoot->mPersonFolderModelMap[item->getID()] = item;
mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget;
+
+ //Create a session
+ item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel);
+ params.name = item->getDisplayName();
+ params.root = mConversationsRoot;
+ params.listener = item;
+ params.tool_tip = params.name;
+ widget = LLUICtrlFactory::create<LLPersonTabView>(params);
+ widget->addToFolder(mConversationsRoot);
+
+ mConversationsRoot->mPersonFolderModelMap[item->getID()] = item;
+ mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget;
gIdleCallbacks.addFunction(idle, this);
diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp
index d94c8cf32f..dac3dd03c7 100644
--- a/indra/newview/llpersonfolderview.cpp
+++ b/indra/newview/llpersonfolderview.cpp
@@ -45,6 +45,25 @@ LLPersonFolderView::~LLPersonFolderView()
mConversationsEventStream.stopListening("ConversationsRefresh");
}
+BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask )
+{
+ LLFolderViewItem * prior_item = getCurSelectedItem();
+ LLFolderViewItem * current_item;
+
+ bool selected_item = LLFolderView::handleMouseDown(x, y, mask);
+
+ current_item = getCurSelectedItem();
+
+ LLPersonTabView * prior_folder = dynamic_cast<LLPersonTabView *>(prior_item);
+
+ if(prior_folder && current_item != prior_folder)
+ {
+ prior_folder->highlight = false;
+ }
+
+ return selected_item;
+}
+
bool LLPersonFolderView::onConversationModelEvent(const LLSD &event)
{
std::string type = event.get("type").asString();
diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h
index 60260dc5ea..74e9142a7c 100644
--- a/indra/newview/llpersonfolderview.h
+++ b/indra/newview/llpersonfolderview.h
@@ -51,9 +51,10 @@ public:
~LLPersonFolderView();
bool onConversationModelEvent(const LLSD &event);
-
LLPersonView * createConversationViewParticipant(LLPersonModel * item);
+ BOOL handleMouseDown( S32 x, S32 y, MASK mask );
+
person_folder_model_map mPersonFolderModelMap;
person_folder_view_map mPersonFolderViewMap;
LLEventStream mConversationsEventStream;
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index fff72c7758..20db0572fc 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -37,7 +37,8 @@ LLPersonTabView::Params::Params()
{}
LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) :
-LLFolderViewFolder(p)
+LLFolderViewFolder(p),
+highlight(false)
{
}
@@ -52,6 +53,18 @@ LLPersonTabView::~LLPersonTabView()
}
+BOOL LLPersonTabView::handleMouseDown( S32 x, S32 y, MASK mask )
+{
+ bool selected_item = LLFolderViewFolder::handleMouseDown(x, y, mask);
+
+ if(selected_item)
+ {
+ highlight = true;
+ }
+
+ return selected_item;
+}
+
void LLPersonTabView::draw()
{
static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
@@ -68,7 +81,7 @@ void LLPersonTabView::draw()
LLColor4 color = sFgColor;
F32 right_x = 0;
- drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
+ drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
updateLabelRotation();
drawOpenFolderArrow(default_params, sFgColor);
diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h
index 9aabad26fc..df3f786c69 100644
--- a/indra/newview/llpersontabview.h
+++ b/indra/newview/llpersontabview.h
@@ -44,7 +44,9 @@ public:
virtual ~LLPersonTabView();
S32 getLabelXPos();
+ bool highlight;
+ BOOL handleMouseDown( S32 x, S32 y, MASK mask );
protected:
void draw();