From 59c586d0c635fc4fa308170fe5532dd2bb3f529b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 7 Jul 2022 18:14:49 +0300 Subject: SL-17666 Allow Map sidebar UI to be hidden --- indra/newview/llfloaterworldmap.cpp | 19 +++++ indra/newview/llfloaterworldmap.h | 2 + .../default/textures/map_ui_collapse_icon.png | Bin 0 -> 300 bytes .../skins/default/textures/map_ui_expand_icon.png | Bin 0 -> 284 bytes indra/newview/skins/default/textures/textures.xml | 2 + .../skins/default/xui/en/floater_world_map.xml | 90 +++++++++++++++++---- 6 files changed, 97 insertions(+), 16 deletions(-) create mode 100644 indra/newview/skins/default/textures/map_ui_collapse_icon.png create mode 100644 indra/newview/skins/default/textures/map_ui_expand_icon.png (limited to 'indra') diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 2c84cd1f93..09235d8fb2 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -45,6 +45,7 @@ //#include "llfirstuse.h" #include "llfloaterreg.h" // getTypedInstance() #include "llfocusmgr.h" +#include "lliconctrl.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" @@ -307,6 +308,8 @@ BOOL LLFloaterWorldMap::postBuild() mCurZoomVal = log(LLWorldMapView::sMapScale/256.f)/log(2.f); getChild("zoom slider")->setValue(mCurZoomVal); + + getChild("expand_btn_panel")->setMouseDownCallback(boost::bind(&LLFloaterWorldMap::onExpandCollapseBtn, this)); setDefaultBtn(NULL); @@ -1315,6 +1318,22 @@ void LLFloaterWorldMap::onCopySLURL() LLNotificationsUtil::add("CopySLURL", args); } +void LLFloaterWorldMap::onExpandCollapseBtn() +{ + LLLayoutStack* floater_stack = getChild("floater_map_stack"); + LLLayoutPanel* controls_panel = getChild("controls_lp"); + + bool toggle_collapse = !controls_panel->isCollapsed(); + floater_stack->collapsePanel(controls_panel, toggle_collapse); + floater_stack->updateLayout(); + + std::string image_name = getString(toggle_collapse ? "expand_icon" : "collapse_icon"); + std::string tooltip = getString(toggle_collapse ? "expand_tooltip" : "collapse_tooltip"); + getChild("expand_collapse_icon")->setImage(LLUI::getUIImage(image_name)); + getChild("expand_collapse_icon")->setToolTip(tooltip); + getChild("expand_btn_panel")->setToolTip(tooltip); +} + // protected void LLFloaterWorldMap::centerOnTarget(BOOL animate) { diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 14a9c26fb9..fcb55e9666 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -130,6 +130,8 @@ protected: void onShowAgentBtn(); void onCopySLURL(); + void onExpandCollapseBtn(); + void centerOnTarget(BOOL animate); void updateLocation(); diff --git a/indra/newview/skins/default/textures/map_ui_collapse_icon.png b/indra/newview/skins/default/textures/map_ui_collapse_icon.png new file mode 100644 index 0000000000..e4de49d4af Binary files /dev/null and b/indra/newview/skins/default/textures/map_ui_collapse_icon.png differ diff --git a/indra/newview/skins/default/textures/map_ui_expand_icon.png b/indra/newview/skins/default/textures/map_ui_expand_icon.png new file mode 100644 index 0000000000..08734b4cc0 Binary files /dev/null and b/indra/newview/skins/default/textures/map_ui_expand_icon.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index a5ebfb3395..e9ef888a7f 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -810,6 +810,8 @@ with the same filename but different name + + diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml index 83407069d2..45e11fc836 100644 --- a/indra/newview/skins/default/xui/en/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -14,6 +14,31 @@ single_instance="true" title="WORLD MAP" width="650"> + + + + + + + + + + + + name="layout_panel_1" + height="22" + width="238" + follows="right|top" + top="6" + background_visible="true" + bg_alpha_color="DkGray2"> Legend - +