diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llpersonfolderview.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llpersonfolderview.h | 3 | ||||
-rw-r--r-- | indra/newview/llpersontabview.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llpersontabview.h | 2 |
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(); |