diff options
author | Andrew Dyukov <adyukov@productengine.com> | 2010-08-02 21:00:02 +0300 |
---|---|---|
committer | Andrew Dyukov <adyukov@productengine.com> | 2010-08-02 21:00:02 +0300 |
commit | 713417aeeb33f10146b15f1a5da91a6da01b4af1 (patch) | |
tree | 67f92edf0eb5bfdd49232081bad85a96a6c89cd3 | |
parent | 367428e09e6e896aa125939f1c69992601588349 (diff) |
EXT-5609 FIXED Avoided showing script floater undocked if it was created in mouselook mode.
Commiting on behalf of Alex Productengine.
- Added check if floater is constructed in mouselook mode and added forcing dock state when floater is shown after constructing in mouselook mode.
Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/830/
--HG--
branch : product-engine
-rw-r--r-- | indra/llui/lldockablefloater.cpp | 15 | ||||
-rw-r--r-- | indra/llui/lldockablefloater.h | 7 | ||||
-rw-r--r-- | indra/newview/llscriptfloater.cpp | 2 |
3 files changed, 24 insertions, 0 deletions
diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index 4f5fcddbf4..f9983278d1 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -50,6 +50,7 @@ void LLDockableFloater::init(LLDockableFloater* thiz) thiz->setCanDock(true); thiz->setCanMinimize(TRUE); thiz->setOverlapsScreenChannel(false); + thiz->mForceDocking = false; } LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, @@ -81,6 +82,12 @@ LLDockableFloater::~LLDockableFloater() BOOL LLDockableFloater::postBuild() { + // Remember we should force docking when the floater is opened for the first time + if (mIsDockedStateForcedCallback != NULL && mIsDockedStateForcedCallback()) + { + mForceDocking = true; + } + mDockTongue = LLUI::getUIImage("windows/Flyout_Pointer.png"); LLFloater::setDocked(true); return LLView::postBuild(); @@ -134,6 +141,14 @@ void LLDockableFloater::resetInstance() void LLDockableFloater::setVisible(BOOL visible) { + // Force docking if requested + if (visible && mForceDocking) + { + setCanDock(true); + setDocked(true); + mForceDocking = false; + } + if(visible && isDocked()) { resetInstance(); diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index 2b1ce99ae2..054d59b984 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -130,6 +130,10 @@ protected: void setDockControl(LLDockControl* dockControl); const LLUIImagePtr& getDockTongue(); + // Checks if docking should be forced. + // It may be useful e.g. if floater created in mouselook mode (see EXT-5609) + boost::function<BOOL ()> mIsDockedStateForcedCallback; + private: std::auto_ptr<LLDockControl> mDockControl; LLUIImagePtr mDockTongue; @@ -143,6 +147,9 @@ private: bool mUseTongue; bool mOverlapsScreenChannel; + + // Force docking when the floater is being shown for the first time. + bool mForceDocking; }; #endif /* LL_DOCKABLEFLOATER_H */ diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 75797dae81..f124659910 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -32,6 +32,7 @@ #include "llviewerprecompiledheaders.h" #include "llscriptfloater.h" +#include "llagentcamera.h" #include "llbottomtray.h" #include "llchannelmanager.h" @@ -71,6 +72,7 @@ LLScriptFloater::LLScriptFloater(const LLSD& key) { setMouseDownCallback(boost::bind(&LLScriptFloater::onMouseDown, this)); setOverlapsScreenChannel(true); + mIsDockedStateForcedCallback = boost::bind(&LLAgentCamera::cameraMouselook, &gAgentCamera); } bool LLScriptFloater::toggle(const LLUUID& notification_id) |