diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-03 13:35:33 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-03 13:35:33 +0100 |
commit | 6bff1b1444dca9c0230fd5996b9136cb2f76c8f1 (patch) | |
tree | 1945871fd38361534236096995d51fef9a5130ac /indra/llui | |
parent | 665274abad307e8c5fff38660e3cd7e9a912abe4 (diff) | |
parent | 48ccc7ccfbe3e94f9dd78ced588e0a76d03fe070 (diff) |
merge from PE's viewer-trunk
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lldockablefloater.cpp | 15 | ||||
-rw-r--r-- | indra/llui/lldockablefloater.h | 7 |
2 files changed, 22 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 */ |