diff options
-rw-r--r-- | indra/newview/llsidetraypanelcontainer.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llsidetraypanelcontainer.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_side_tray.xml | 1 |
3 files changed, 15 insertions, 13 deletions
diff --git a/indra/newview/llsidetraypanelcontainer.cpp b/indra/newview/llsidetraypanelcontainer.cpp index 3024492ab9..f2215a2250 100644 --- a/indra/newview/llsidetraypanelcontainer.cpp +++ b/indra/newview/llsidetraypanelcontainer.cpp @@ -38,6 +38,7 @@ static LLDefaultChildRegistry::Register<LLSideTrayPanelContainer> r2("panel_cont std::string LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME = "sub_panel_name"; LLSideTrayPanelContainer::Params::Params() + : default_panel_name("default_panel_name") { // Always hide tabs. hide_tabs(true); @@ -45,6 +46,7 @@ LLSideTrayPanelContainer::Params::Params() LLSideTrayPanelContainer::LLSideTrayPanelContainer(const Params& p) : LLTabContainer(p) + , mDefaultPanelName(p.default_panel_name) { } @@ -53,19 +55,14 @@ void LLSideTrayPanelContainer::onOpen(const LLSD& key) // Select specified panel and save navigation history. if(key.has(PARAM_SUB_PANEL_NAME)) { + //*NOTE dzaporozhan + // Navigation history is not used after fix for EXT-3186, + // openPreviousPanel() always opens default panel + // Save panel navigation history std::string panel_name = key[PARAM_SUB_PANEL_NAME]; - S32 old_index = getCurrentPanelIndex(); selectTabByName(panel_name); - - S32 new_index = getCurrentPanelIndex(); - - // Don't update navigation history if we are opening same panel again. - if(old_index != new_index) - { - mPanelHistory[panel_name] = old_index; - } } // Will reopen current panel if no panel name was passed. getCurrentPanel()->onOpen(key); @@ -73,11 +70,13 @@ void LLSideTrayPanelContainer::onOpen(const LLSD& key) void LLSideTrayPanelContainer::openPreviousPanel() { - std::string current_panel_name = getCurrentPanel()->getName(); - panel_navigation_history_t::const_iterator it = mPanelHistory.find(current_panel_name); - if(mPanelHistory.end() != it) + if(!mDefaultPanelName.empty()) + { + selectTabByName(mDefaultPanelName); + } + else { - selectTab(it->second); + selectTab(0); } } diff --git a/indra/newview/llsidetraypanelcontainer.h b/indra/newview/llsidetraypanelcontainer.h index 3f3cb552f8..beed328269 100644 --- a/indra/newview/llsidetraypanelcontainer.h +++ b/indra/newview/llsidetraypanelcontainer.h @@ -51,6 +51,7 @@ public: struct Params : public LLInitParam::Block<Params, LLTabContainer::Params> { + Optional<std::string> default_panel_name; Params(); }; @@ -90,6 +91,7 @@ protected: // Navigation history panel_navigation_history_t mPanelHistory; + std::string mDefaultPanelName; }; #endif //LL_LLSIDETRAY_PANEL_CONTAINER_H diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml index 63b7112c17..4565663bba 100644 --- a/indra/newview/skins/default/xui/en/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml @@ -42,6 +42,7 @@ > <panel_container name="panel_container" + default_panel_name="panel_people" width="333" > <panel |