diff options
author | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-01-15 21:56:42 +0200 |
---|---|---|
committer | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-01-15 21:56:42 +0200 |
commit | 506475f8818c398cfd77de2f847c23ae145f8230 (patch) | |
tree | cd63663149a14cbdc98a507a951c0e1c8c30be10 /indra | |
parent | 64d9e73257efd89822435285626d8a5505627778 (diff) |
Fixed normal bug (EXT-4156) [BSI] Friendslist doesn't toggle open/close on shortcut
- Added toggling for friends, groups and nearby people lists.
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1bff04352c..fe82da960c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3369,10 +3369,52 @@ class LLShowPanelPeopleTab : 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"] = userdata.asString(); - LLSideTray::getInstance()->showPanel("panel_people", param); + param["people_panel_tab_name"] = panel_name; + + static LLPanel* friends_panel = NULL; + static LLPanel* groups_panel = NULL; + static LLPanel* nearby_panel = NULL; + + if (panel_name == "friends_panel") + { + return togglePanel(friends_panel, param); + } + else if (panel_name == "groups_panel") + { + return togglePanel(groups_panel, param); + } + else if (panel_name == "nearby_panel") + { + return togglePanel(nearby_panel, param); + } + else + { + return false; + } + } + + static bool togglePanel(LLPanel* &panel, const LLSD& param) + { + if(!panel) + { + panel = LLSideTray::getInstance()->findChild<LLPanel>(param["people_panel_tab_name"].asString()); + if(!panel) + return false; + } + + if (panel->isInVisibleChain()) + { + LLSideTray::getInstance()->collapseSideBar(); + } + else + { + LLSideTray::getInstance()->showPanel("panel_people", param); + } + return true; } }; |