diff options
author | Eugene Mutavchi <emutavchi@productengine.com> | 2009-11-27 17:27:39 +0200 |
---|---|---|
committer | Eugene Mutavchi <emutavchi@productengine.com> | 2009-11-27 17:27:39 +0200 |
commit | 2b92341813b0b53d306683d6fc97428c40618fce (patch) | |
tree | 05494e85ef9890df368c736f73cf8aac703c84f0 /indra/newview/llfloatercamera.cpp | |
parent | a703d9eff9af18b109d44e677e616209b1272a13 (diff) |
Fixed normal bug EXT-2727 (View tool should remember state)
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llfloatercamera.cpp')
-rw-r--r-- | indra/newview/llfloatercamera.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index 92e958b32d..764aff68c9 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -215,17 +215,38 @@ void LLFloaterCamera::onOpen(const LLSD& key) getDockTongue(), LLDockControl::TOP)); mZoom->onOpen(key); + + // Returns to previous mode, see EXT-2727(View tool should remember state). + // In case floater was just hidden and it isn't reset the mode + // just update state to current one. Else go to previous. + if ( !mClosed ) + updateState(); + else + toPrevMode(); + mClosed = FALSE; } void LLFloaterCamera::onClose(bool app_quitting) { //We don't care of camera mode if app is quitting - if(!app_quitting) - switchMode(CAMERA_CTRL_MODE_ORBIT); + if(app_quitting) + return; + // When mCurrMode is in CAMERA_CTRL_MODE_ORBIT + // switchMode won't modify mPrevMode, so force it here. + // It is needed to correctly return to previous mode on open, see EXT-2727. + if (mCurrMode == CAMERA_CTRL_MODE_ORBIT) + mPrevMode = CAMERA_CTRL_MODE_ORBIT; + + // HACK: Should always close as docked to prevent toggleInstance without calling onOpen. + if ( !isDocked() ) + setDocked(true); + switchMode(CAMERA_CTRL_MODE_ORBIT); + mClosed = TRUE; } LLFloaterCamera::LLFloaterCamera(const LLSD& val) : LLTransientDockableFloater(NULL, true, val), + mClosed(FALSE), mCurrMode(CAMERA_CTRL_MODE_ORBIT), mPrevMode(CAMERA_CTRL_MODE_ORBIT) { |