diff options
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f87d5693e8..88a61c9d49 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3365,13 +3365,13 @@ void handle_show_side_tray() root->addChild(side_tray); } -class LLShowPanelPeopleTab : public view_listener_t +// Toggle one of "People" panel tabs in side tray. +class LLTogglePanelPeopleTab : public view_listener_t { bool handleEvent(const LLSD& userdata) { std::string panel_name = userdata.asString(); - // Open tab of the "People" panel in side tray. LLSD param; param["people_panel_tab_name"] = panel_name; @@ -3381,15 +3381,15 @@ class LLShowPanelPeopleTab : public view_listener_t if (panel_name == "friends_panel") { - return togglePanel(friends_panel, param); + return togglePeoplePanel(friends_panel, panel_name, param); } else if (panel_name == "groups_panel") { - return togglePanel(groups_panel, param); + return togglePeoplePanel(groups_panel, panel_name, param); } else if (panel_name == "nearby_panel") { - return togglePanel(nearby_panel, param); + return togglePeoplePanel(nearby_panel, panel_name, param); } else { @@ -3397,23 +3397,16 @@ class LLShowPanelPeopleTab : public view_listener_t } } - static bool togglePanel(LLPanel* &panel, const LLSD& param) + static bool togglePeoplePanel(LLPanel* &panel, const std::string& panel_name, const LLSD& param) { if(!panel) { - panel = LLSideTray::getInstance()->findChild<LLPanel>(param["people_panel_tab_name"].asString()); + panel = LLSideTray::getInstance()->getPanel(panel_name); if(!panel) return false; } - if (panel->isInVisibleChain()) - { - LLSideTray::getInstance()->collapseSideBar(); - } - else - { - LLSideTray::getInstance()->showPanel("panel_people", param); - } + LLSideTray::getInstance()->togglePanel(panel, "panel_people", param); return true; } @@ -7940,7 +7933,7 @@ void initialize_menus() view_listener_t::addMenu(new LLSelfEnableRemoveAllAttachments(), "Self.EnableRemoveAllAttachments"); // we don't use boost::bind directly to delay side tray construction - view_listener_t::addMenu( new LLShowPanelPeopleTab(), "SideTray.PanelPeopleTab"); + view_listener_t::addMenu( new LLTogglePanelPeopleTab(), "SideTray.PanelPeopleTab"); // Avatar pie menu view_listener_t::addMenu(new LLObjectMute(), "Avatar.Mute"); |