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 | |
parent | a703d9eff9af18b109d44e677e616209b1272a13 (diff) |
Fixed normal bug EXT-2727 (View tool should remember state)
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloatercamera.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llfloatercamera.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_camera.xml | 1 |
3 files changed, 25 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) { diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index 4873a34e00..5d44b4944d 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -109,6 +109,7 @@ private: void assignButton2Mode(ECameraControlMode mode, const std::string& button_name); + BOOL mClosed; ECameraControlMode mPrevMode; ECameraControlMode mCurrMode; std::map<ECameraControlMode, LLButton*> mMode2Button; diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index 69f9f6a2f8..d378b427f1 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -12,6 +12,7 @@ help_topic="camera_floater" save_rect="true" save_visibility="true" + single_instance="true" width="150"> <floater.string name="rotate_tooltip"> |