From 4b44be799a578b946e440a4bc90aca0610734003 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 21 Aug 2012 18:10:45 +0300 Subject: MAINT-1416 FIXED Close Mini-map floater after Ctrl-W if it's opened and other floaters are not in focus --- indra/newview/llfloatermap.cpp | 5 +++++ indra/newview/llfloatermap.h | 1 + indra/newview/llviewermenufile.cpp | 9 +++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 539869a084..473e2938be 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -246,3 +246,8 @@ void LLFloaterMap::handleZoom(const LLSD& userdata) mMap->setScale(scale); } } + +LLFloaterMap* LLFloaterMap::getInstance() +{ + return LLFloaterReg::getTypedInstance("mini_map"); +} diff --git a/indra/newview/llfloatermap.h b/indra/newview/llfloatermap.h index 8a1b965e62..ff2fb20535 100644 --- a/indra/newview/llfloatermap.h +++ b/indra/newview/llfloatermap.h @@ -39,6 +39,7 @@ class LLFloaterMap : public LLFloater { public: LLFloaterMap(const LLSD& key); + static LLFloaterMap* getInstance(); virtual ~LLFloaterMap(); /*virtual*/ BOOL postBuild(); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index f791d906e6..21a323941d 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -34,6 +34,7 @@ #include "llfilepicker.h" #include "llfloaterreg.h" #include "llbuycurrencyhtml.h" +#include "llfloatermap.h" #include "llfloatermodelpreview.h" #include "llfloatersnapshot.h" #include "llimage.h" @@ -476,7 +477,7 @@ class LLFileEnableCloseWindow : public view_listener_t bool handleEvent(const LLSD& userdata) { bool new_value = NULL != LLFloater::getClosableFloaterFromFocus(); - return new_value; + return new_value || LLFloaterMap::getInstance()->isInVisibleChain(); } }; @@ -484,8 +485,12 @@ class LLFileCloseWindow : public view_listener_t { bool handleEvent(const LLSD& userdata) { + bool new_value = (NULL == LLFloater::getClosableFloaterFromFocus()); + if(new_value && LLFloaterMap::getInstance()->isInVisibleChain()) + { + LLFloaterMap::getInstance()->closeFloater(false); + } LLFloater::closeFocusedFloater(); - return true; } }; -- cgit v1.2.3