diff options
| author | Merov Linden <merov@lindenlab.com> | 2011-10-19 19:44:30 -0700 | 
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2011-10-19 19:44:30 -0700 | 
| commit | aa3f5edc83a6a20f0473fff6f28fdad6f5406dc2 (patch) | |
| tree | 192da0c80b9b9b76486c2b174297b9dfd8f8b7de | |
| parent | c8499a7b607171507df8cbb6f415dfaa66699b2a (diff) | |
| parent | 832a509c38035447ece2d0ae77c8661311e72d7e (diff) | |
Pull from richard/viewer-experience-fui
23 files changed, 159 insertions, 137 deletions
| diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index ca2dc644a4..aea58be12a 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -162,10 +162,15 @@ void LLDockableFloater::setVisible(BOOL visible)  void LLDockableFloater::setMinimized(BOOL minimize)  { -	if(minimize) +	if(minimize && isDocked())  	{ +		// minimizing a docked floater just hides it  		setVisible(FALSE);  	} +	else +	{ +		LLFloater::setMinimized(minimize); +	}  }  LLView * LLDockableFloater::getDockWidget() diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 3085921e04..bd537bfb19 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -165,6 +165,7 @@ LLFloater::Params::Params()  :	title("title"),  	short_title("short_title"),  	single_instance("single_instance", false), +	reuse_instance("reuse_instance", false),  	can_resize("can_resize", false),  	can_minimize("can_minimize", true),  	can_close("can_close", true), @@ -239,6 +240,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)  	mTitle(p.title),  	mShortTitle(p.short_title),  	mSingleInstance(p.single_instance), +	mReuseInstance(p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance), // reuse single-instance floaters by default  	mKey(key),  	mCanTearOff(p.can_tear_off),  	mCanMinimize(p.can_minimize), @@ -683,7 +685,12 @@ void LLFloater::openFloater(const LLSD& key)  	}  	else  	{ -		applyControlsAndPosition(LLFloaterReg::getLastFloaterCascading()); +		LLFloater* floater_to_stack = LLFloaterReg::getLastFloaterInGroup(mInstanceName); +		if (!floater_to_stack) +		{ +			floater_to_stack = LLFloaterReg::getLastFloaterCascading(); +		} +		applyControlsAndPosition(floater_to_stack);  		setMinimized(FALSE);  		setVisibleAndFrontmost(mAutoFocus);  	} @@ -776,12 +783,19 @@ void LLFloater::closeFloater(bool app_quitting)  			else  			{  				setVisible(FALSE); +				if (!mReuseInstance) +				{ +					destroy(); +				}  			}  		}  		else  		{  			setVisible(FALSE); // hide before destroying (so handleVisibilityChange() gets called) -			destroy(); +			if (!mReuseInstance) +			{ +				destroy(); +			}  		}  	}  } @@ -861,9 +875,15 @@ bool LLFloater::applyRectControl()  {  	bool saved_rect = false; -	// If we have a saved rect, use it -	if (mRectControl.size() > 1) +	if (LLFloaterReg::getLastFloaterInGroup(mInstanceName))  	{ +		// other floaters in our group, position ourselves relative to them and don't save the rect +		mRectControl.clear(); +		mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_CASCADING; +	} +	else if (mRectControl.size() > 1) +	{ +		// If we have a saved rect, use it  		const LLRect& rect = getControlGroup()->getRect(mRectControl);  		saved_rect = rect.notEmpty();  		if (saved_rect) @@ -1051,6 +1071,7 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user)  	if (by_user)  	{  		storeRectControl(); +		mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_NONE;  	}  	// if not minimized, adjust all snapped dependents to new shape @@ -1382,7 +1403,10 @@ void LLFloater::moveResizeHandlesToFront()  BOOL LLFloater::isFrontmost()  { -	return gFloaterView && gFloaterView->getFrontmost() == this && getVisible(); +	LLFloaterView* floater_view = getParentByType<LLFloaterView>(); +	return getVisible() +			&& (floater_view  +				&& floater_view->getFrontmost() == this);  }  void LLFloater::addDependentFloater(LLFloater* floaterp, BOOL reposition) @@ -1455,6 +1479,7 @@ BOOL LLFloater::handleMouseDown(S32 x, S32 y, MASK mask)  		if(offerClickToButton(x, y, mask, BUTTON_CLOSE)) return TRUE;  		if(offerClickToButton(x, y, mask, BUTTON_RESTORE)) return TRUE;  		if(offerClickToButton(x, y, mask, BUTTON_TEAR_OFF)) return TRUE; +		if(offerClickToButton(x, y, mask, BUTTON_DOCK)) return TRUE;  		// Otherwise pass to drag handle for movement  		return mDragHandle->handleMouseDown(x, y, mask); @@ -1560,6 +1585,12 @@ void LLFloater::setDocked(bool docked, bool pop_on_undock)  	{  		mDocked = docked;  		mButtonsEnabled[BUTTON_DOCK] = !mDocked; + +		if (mDocked) +		{ +			setMinimized(FALSE); +		} +  		updateTitleButtons();  		storeDockStateControl(); @@ -2949,6 +2980,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p)  	mHeaderHeight = p.header_height;  	mLegacyHeaderHeight = p.legacy_header_height;  	mSingleInstance = p.single_instance; +	mReuseInstance = p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance;  	mOpenPositioning = p.open_positioning;  	mSpecifiedLeft = p.specified_left; @@ -3230,7 +3262,6 @@ void LLFloater::stackWith(LLFloater& other)  	next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, getRect().getWidth(), getRect().getHeight()); -	mRectControl.clear(); // don't save rect of stacked floaters  	setShape(next_rect);  } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index f610b04e35..f384e64e53 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -120,6 +120,7 @@ public:  								short_title;  		Optional<bool>			single_instance, +								reuse_instance,  								can_resize,  								can_minimize,  								can_close, @@ -409,6 +410,7 @@ private:  	LLUIString		mShortTitle;  	BOOL			mSingleInstance;	// TRUE if there is only ever one instance of the floater +	bool			mReuseInstance;		// true if we want to hide the floater when we close it instead of destroying it  	std::string		mInstanceName;		// Store the instance name so we can remove ourselves from the list  	BOOL			mCanTearOff; diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index df3cff9968..e144b68f5e 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -167,6 +167,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key)  				res->setInstanceName(name);  				LLFloater *last_floater = (list.empty() ? NULL : list.back()); +  				res->applyControlsAndPosition(last_floater);  				gFloaterView->adjustToFitScreen(res, false); diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index c559a2bf1d..bceda9bf54 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -217,7 +217,7 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank)  	if ((rank >= mButtonCommands.size()) || (rank == RANK_NONE))  	{  		// In that case, back load -		mButtonCommands.push_back(commandId); +		mButtonCommands.push_back(command->id());  		mButtons.push_back(button);  	}  	else  @@ -232,7 +232,7 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank)  			rank--;  		}  		// ...then insert -		mButtonCommands.insert(it_command,commandId); +		mButtonCommands.insert(it_command, command->id());  		mButtons.insert(it_button,button);  	} @@ -821,7 +821,7 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)  	if (!commandp) return NULL;  	LLToolBarButton::Params button_p; -	button_p.name = id.name(); +	button_p.name = commandp->id().name();  // Make sure to retrieve the name from the command itself, not the passed in id  	button_p.label = LLTrans::getString(commandp->labelRef());  	button_p.tool_tip = LLTrans::getString(commandp->tooltipRef());  	button_p.image_overlay = LLUI::getUIImage(commandp->icon()); @@ -999,13 +999,13 @@ BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask)  	{  		if (!mIsDragged)  		{ -			mStartDragItemCallback(x,y,mId.uuid()); +			mStartDragItemCallback(x, y, this);  			mIsDragged = true;  			handled = TRUE;  		}  		else   		{ -			handled = mHandleDragItemCallback(x,y,mId.uuid(),LLAssetType::AT_WIDGET); +			handled = mHandleDragItemCallback(x, y, mId.uuid(), LLAssetType::AT_WIDGET);  		}  	}  	else diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index ad42d1fa35..e634e57f93 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -36,8 +36,9 @@  #include "llassettype.h"  class LLToolBar; +class LLToolBarButton; -typedef boost::function<void (S32 x, S32 y, const LLUUID& uuid)> tool_startdrag_callback_t; +typedef boost::function<void (S32 x, S32 y, LLToolBarButton* button)> tool_startdrag_callback_t;  typedef boost::function<BOOL (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> tool_handledrag_callback_t;  typedef boost::function<BOOL (void* data, S32 x, S32 y, LLToolBar* toolbar)> tool_handledrop_callback_t; diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 391a864846..a44b895f7b 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -10,7 +10,7 @@             is_running_function="Floater.IsOpen"             is_running_parameters="about_land"             /> -  <command name="appearance" +  <command name="appearance"               available_in_toybox="true"             icon="Command_Appearance_Icon"             label_ref="Command_Appearance_Label" diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 773e20eda7..21cb3380c9 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -175,7 +175,7 @@ bool LLAgent::isActionAllowed(const LLSD& sdname)  	}  	else if (param == "speak")  	{ -		if ( gAgent.isVoiceConnected() ) +		if ( gAgent.isVoiceConnected() && LLViewerParcelMgr::getInstance()->allowAgentVoice() )  		{  			retval = true;  		} @@ -305,13 +305,6 @@ LLAgent::LLAgent() :  	mListener.reset(new LLAgentListener(*this));  	mMoveTimer.stop(); - -	LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback)); - -	LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2)); -	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2)); -	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2)); -	LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2));  }  // Requires gSavedSettings to be initialized. @@ -333,6 +326,14 @@ void LLAgent::init()  	gSavedSettings.getControl("PreferredMaturity")->getValidateSignal()->connect(boost::bind(&LLAgent::validateMaturity, this, _2));  	gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLAgent::handleMaturity, this, _2)); + +	LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback)); + +	LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2)); +	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2)); +	LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2)); +	LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2)); +  	mInitialized = TRUE;  } diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index cc6ba05e7e..ba511a3693 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -147,3 +147,12 @@ LLDebugView::~LLDebugView()  	gTextureCategoryView = NULL;  } +void LLDebugView::draw() +{ +	LLView* floater_snap_region = getRootView()->getChildView("floater_snap_region"); +	LLRect debug_rect; +	floater_snap_region->localRectToOtherView(floater_snap_region->getLocalRect(), &debug_rect, getParent()); + +	setShape(debug_rect); +	LLView::draw(); +} diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h index 20262fc89e..907a42c981 100644 --- a/indra/newview/lldebugview.h +++ b/indra/newview/lldebugview.h @@ -55,6 +55,7 @@ public:  	~LLDebugView();  	void init(); +	void draw();  	void setStatsVisible(BOOL visible); diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp index b4c9894271..66f644748e 100644 --- a/indra/newview/llfloatertoybox.cpp +++ b/indra/newview/llfloatertoybox.cpp @@ -39,7 +39,6 @@  LLFloaterToybox::LLFloaterToybox(const LLSD& key)  	: LLFloater(key) -	, mBtnRestoreDefaults(NULL)  	, mToolBar(NULL)  {  	mCommitCallbackRegistrar.add("Toybox.RestoreDefaults", boost::bind(&LLFloaterToybox::onBtnRestoreDefaults, this)); @@ -59,20 +58,19 @@ bool compare_localized_command_labels(LLCommand * cmd1, LLCommand * cmd2)  BOOL LLFloaterToybox::postBuild()  {	 -	mBtnRestoreDefaults = getChild<LLButton>("btn_restore_defaults");  	mToolBar = getChild<LLToolBar>("toybox_toolbar"); +  	mToolBar->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3));  	mToolBar->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4));  	mToolBar->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4)); -	LLCommandManager& cmdMgr = LLCommandManager::instance(); -  	//  	// Sort commands by localized labels so they will appear alphabetized in all languages  	//  	std::list<LLCommand *> alphabetized_commands; +	LLCommandManager& cmdMgr = LLCommandManager::instance();  	for (U32 i = 0; i < cmdMgr.commandCount(); i++)  	{  		LLCommand * command = cmdMgr.getCommand(i); diff --git a/indra/newview/llfloatertoybox.h b/indra/newview/llfloatertoybox.h index f0a6cf1a8b..62bf68680d 100644 --- a/indra/newview/llfloatertoybox.h +++ b/indra/newview/llfloatertoybox.h @@ -53,7 +53,6 @@ protected:  	void onBtnRestoreDefaults();  public: -	LLButton *	mBtnRestoreDefaults;  	LLToolBar *	mToolBar;  }; diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 6a72bade67..a811332261 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -53,6 +53,8 @@  S32 LLNearbyChatBar::sLastSpecialChatChannel = 0;  const S32 EXPANDED_HEIGHT = 300; +const S32 COLLAPSED_HEIGHT = 60; +const S32 EXPANDED_MIN_HEIGHT = 150;  // legacy callback glue  void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); @@ -102,7 +104,7 @@ BOOL LLNearbyChatBar::postBuild()  	// Register for font change notifications  	LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1)); -	mExpandedHeight = getMinHeight() + EXPANDED_HEIGHT; +	mExpandedHeight = COLLAPSED_HEIGHT + EXPANDED_HEIGHT;  	enableResizeCtrls(true, true, false); @@ -122,6 +124,7 @@ bool LLNearbyChatBar::applyRectControl()  	else  	{  		enableResizeCtrls(true); +		setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT);  	}  	return rect_controlled; @@ -377,15 +380,19 @@ void LLNearbyChatBar::onToggleNearbyChatPanel()  	if (nearby_chat->getVisible())  	{  		mExpandedHeight = getRect().getHeight(); +		setResizeLimits(getMinWidth(), COLLAPSED_HEIGHT);  		nearby_chat->setVisible(FALSE); -		reshape(getRect().getWidth(), getMinHeight()); +		reshape(getRect().getWidth(), COLLAPSED_HEIGHT);  		enableResizeCtrls(true, true, false); +		storeRectControl();  	}  	else  	{  		nearby_chat->setVisible(TRUE); +		setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT);  		reshape(getRect().getWidth(), mExpandedHeight);  		enableResizeCtrls(true); +		storeRectControl();  	}  } diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index c7c8268eb9..75bec15082 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -63,7 +63,9 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p)  :	LLUICtrl(p),  	mToolbarLeft(NULL),  	mToolbarRight(NULL), -	mToolbarBottom(NULL) +	mToolbarBottom(NULL), +	mDragStarted(false), +	mDragToolbarButton(NULL)  {  } @@ -278,13 +280,19 @@ void LLToolBarView::saveToolbars() const  // Enumerate the commands in command_list and add them as Params to the toolbar  void LLToolBarView::addToToolset(command_id_list_t& command_list, Toolbar& toolbar) const  { +	LLCommandManager& mgr = LLCommandManager::instance(); +  	for (command_id_list_t::const_iterator it = command_list.begin();  		 it != command_list.end();  		 ++it)  	{ -		LLCommandId::Params command; -		command.name = it->name();		 -		toolbar.commands.add(command); +		LLCommand* command = mgr.getCommand(*it); +		if (command) +		{ +			LLCommandId::Params commandParams; +			commandParams.name = command->id().name(); +			toolbar.commands.add(commandParams); +		}  	}  } @@ -328,13 +336,11 @@ void LLToolBarView::draw()  // ---------------------------------------- -void LLToolBarView::startDragTool( S32 x, S32 y, const LLUUID& uuid) +void LLToolBarView::startDragTool(S32 x, S32 y, LLToolBarButton* button)  { +	resetDragTool(button); +  	// Flag the tool dragging but don't start it yet -	gToolBarView->mDragStarted = false; -	gToolBarView->mDragCommand = LLCommandId::null; -	gToolBarView->mDragRank = LLToolBar::RANK_NONE; -	gToolBarView->mDragToolbar = NULL;  	LLToolDragAndDrop::getInstance()->setDragStart( x, y );  } @@ -361,30 +367,6 @@ BOOL LLToolBarView::handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp  			gToolBarView->mToolbarLeft->stopCommandInProgress(command_id);  			gToolBarView->mToolbarRight->stopCommandInProgress(command_id);  			gToolBarView->mToolbarBottom->stopCommandInProgress(command_id); -			 -			// Second, check if the command is present in one of the 3 toolbars -			// If it is, store the command, the toolbar and the rank in the toolbar and -			// set a callback on end drag so that we reinsert the command if no drop happened -			/* -			gToolBarView->mDragCommand = LLCommandId(uuid); -			if ((gToolBarView->mDragRank = gToolBarView->mToolbarLeft->removeCommand(gToolBarView->mDragCommand)) != LLToolBar::RANK_NONE) -			{ -				gToolBarView->mDragToolbar = gToolBarView->mToolbarLeft; -			} -			else if ((gToolBarView->mDragRank = gToolBarView->mToolbarRight->removeCommand(gToolBarView->mDragCommand)) != LLToolBar::RANK_NONE) -			{ -				gToolBarView->mDragToolbar = gToolBarView->mToolbarRight; -			} -			else if ((gToolBarView->mDragRank = gToolBarView->mToolbarBottom->removeCommand(gToolBarView->mDragCommand)) != LLToolBar::RANK_NONE) -			{ -				gToolBarView->mDragToolbar = gToolBarView->mToolbarBottom; -			} -			if (gToolBarView->mDragRank != LLToolBar::RANK_NONE) -			{ -				llinfos << "Merov debug: rank of dragged tool = " << gToolBarView->mDragRank << llendl; -				LLToolDragAndDrop::getInstance()->setEndDragCallback(boost::bind(&LLToolBarView::onEndDrag, gToolBarView)); -			} -			 */  			gToolBarView->mDragStarted = true;  			return TRUE; @@ -413,42 +395,32 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t  		LLCommand* command = mgr.getCommand(command_id);  		if (command)  		{ -			// Convert the (x,y) position in rank in toolbar -			int new_rank = LLToolBar::RANK_NONE; -			if (!toolbar->isReadOnly()) -			{ -				new_rank = toolbar->getRankFromPosition(x,y); -			}  			// Suppress the command from the toolbars (including the one it's dropped in,   			// this will handle move position). -			int old_rank = LLToolBar::RANK_NONE; +			bool command_present = gToolBarView->hasCommand(command_id);  			LLToolBar* old_toolbar = NULL; -			int rank; -			if ((rank = gToolBarView->mToolbarLeft->removeCommand(command_id)) != LLToolBar::RANK_NONE) -			{ -				old_rank = rank; -				old_toolbar = gToolBarView->mToolbarLeft; -			} -			if ((rank = gToolBarView->mToolbarRight->removeCommand(command_id)) != LLToolBar::RANK_NONE) -			{ -				old_rank = rank; -				old_toolbar = gToolBarView->mToolbarRight; -			} -			if ((rank = gToolBarView->mToolbarBottom->removeCommand(command_id)) != LLToolBar::RANK_NONE) + +			if (command_present)  			{ -				old_rank = rank; -				old_toolbar = gToolBarView->mToolbarBottom; +				llassert(gToolBarView->mDragToolbarButton); +				old_toolbar = gToolBarView->mDragToolbarButton->getParentByType<LLToolBar>(); +				if (old_toolbar->isReadOnly() && toolbar->isReadOnly()) +				{ +					// do nothing +				} +				else +				{ +					gToolBarView->mToolbarBottom->removeCommand(command_id); +					gToolBarView->mToolbarLeft->removeCommand(command_id); +					gToolBarView->mToolbarRight->removeCommand(command_id); +				}  			} -			// Now insert it in the toolbar at the detected rank + +			// Convert the (x,y) position in rank in toolbar  			if (!toolbar->isReadOnly())  			{ -				if ((old_toolbar == toolbar) && (old_rank != LLToolBar::RANK_NONE) && (old_rank < new_rank)) -				{ -					// If we just removed the command from the same toolbar, we need to consider that it might -					// change the target rank. -					new_rank -= 1; -				} -				toolbar->addCommand(command->id(),new_rank); +				int new_rank = toolbar->getRankFromPosition(x,y); +				toolbar->addCommand(command_id, new_rank);  			}  		}  		else @@ -456,27 +428,16 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t  			llwarns << "Command couldn't be found in command manager" << llendl;  		}  	} -	stopDragTool(); + +	resetDragTool(NULL);  	return handled;  } -void LLToolBarView::stopDragTool() +void LLToolBarView::resetDragTool(LLToolBarButton* button)  {  	// Clear the saved command, toolbar and rank  	gToolBarView->mDragStarted = false; -	gToolBarView->mDragCommand = LLCommandId::null; -	gToolBarView->mDragRank = LLToolBar::RANK_NONE; -	gToolBarView->mDragToolbar = NULL; -} - -void LLToolBarView::onEndDrag() -{ -	// If there's a saved command, reinsert it in the saved toolbar -	if (gToolBarView->mDragRank != LLToolBar::RANK_NONE) -	{ -		gToolBarView->mDragToolbar->addCommand(gToolBarView->mDragCommand,gToolBarView->mDragRank); -	} -	stopDragTool(); +	gToolBarView->mDragToolbarButton = button;  }  void LLToolBarView::setToolBarsVisible(bool visible) diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index 8b3af43875..60ad6316f8 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -76,11 +76,10 @@ public:  	static bool loadDefaultToolbars(); -	static void startDragTool( S32 x, S32 y, const LLUUID& uuid); -	static BOOL handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type); -	static BOOL handleDropTool(	void* cargo_data, S32 x, S32 y, LLToolBar* toolbar); -	static void stopDragTool(); -	void onEndDrag(); +	static void startDragTool(S32 x, S32 y, LLToolBarButton* button); +	static BOOL handleDragTool(S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type); +	static BOOL handleDropTool(void* cargo_data, S32 x, S32 y, LLToolBar* toolbar); +	static void resetDragTool(LLToolBarButton* button);  	bool isModified() const; @@ -100,10 +99,8 @@ private:  	LLToolBar*	mToolbarRight;  	LLToolBar*	mToolbarBottom; -	LLCommandId mDragCommand; -	int			mDragRank; -	LLToolBar*	mDragToolbar; -	bool		mDragStarted; +	bool				mDragStarted; +	LLToolBarButton*	mDragToolbarButton;  };  extern LLToolBarView* gToolBarView; diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 51c0e2eeed..6bc7c6de11 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -247,24 +247,10 @@ bool LLToolMgr::canEdit()  void LLToolMgr::toggleBuildMode()  { -	if (inBuildMode()) -	{ -		if (gSavedSettings.getBOOL("EditCameraMovement")) -		{ -			// just reset the view, will pull us out of edit mode -			handle_reset_view(); -		} -		else -		{ -			// manually disable edit mode, but do not affect the camera -			gAgentCamera.resetView(false); -			LLFloaterReg::hideInstance("build"); -			gViewerWindow->showCursor();			 -		} -		// avoid spurious avatar movements pulling out of edit mode -		LLViewerJoystick::getInstance()->setNeedsReset(); -	} -	else +	LLFloaterReg::toggleInstanceOrBringToFront("build"); + +	bool build_visible = LLFloaterReg::instanceVisible("build"); +	if (build_visible)  	{  		ECameraMode camMode = gAgentCamera.getCameraMode();  		if (CAMERA_MODE_MOUSELOOK == camMode ||	CAMERA_MODE_CUSTOMIZE_AVATAR == camMode) @@ -291,7 +277,7 @@ void LLToolMgr::toggleBuildMode()  			}  		} -		 +  		setCurrentToolset(gBasicToolset);  		getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); @@ -304,6 +290,24 @@ void LLToolMgr::toggleBuildMode()  		LLViewerJoystick::getInstance()->setNeedsReset();  	} +	else +	{ +		if (gSavedSettings.getBOOL("EditCameraMovement")) +		{ +			// just reset the view, will pull us out of edit mode +			handle_reset_view(); +		} +		else +		{ +			// manually disable edit mode, but do not affect the camera +			gAgentCamera.resetView(false); +			LLFloaterReg::hideInstance("build"); +			gViewerWindow->showCursor();			 +		} +		// avoid spurious avatar movements pulling out of edit mode +		LLViewerJoystick::getInstance()->setNeedsReset(); +	} +  }  bool LLToolMgr::inBuildMode() diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b84db6b1c0..369e56878c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3174,7 +3174,7 @@ void LLViewerWindow::updateLayout()  		//gMenuBarView->setItemVisible("BuildTools", gFloaterTools->getVisible());  	} -	LLFloaterBuildOptions* build_options_floater = LLFloaterReg::getTypedInstance<LLFloaterBuildOptions>("build_options"); +	LLFloaterBuildOptions* build_options_floater = LLFloaterReg::findTypedInstance<LLFloaterBuildOptions>("build_options");  	if (build_options_floater && build_options_floater->getVisible())  	{  		build_options_floater->updateGridMode(); diff --git a/indra/newview/skins/default/xui/en/floater_my_appearance.xml b/indra/newview/skins/default/xui/en/floater_my_appearance.xml index d9f3f1e13f..a40393aed8 100644 --- a/indra/newview/skins/default/xui/en/floater_my_appearance.xml +++ b/indra/newview/skins/default/xui/en/floater_my_appearance.xml @@ -10,6 +10,7 @@    help_topic="appearance"    save_rect="true"    single_instance="true" +  reuse_instance="true"    title="APPEARANCE"    min_height="260"    min_width="333" diff --git a/indra/newview/skins/default/xui/en/floater_my_inventory.xml b/indra/newview/skins/default/xui/en/floater_my_inventory.xml index 44491c671f..80718584e3 100644 --- a/indra/newview/skins/default/xui/en/floater_my_inventory.xml +++ b/indra/newview/skins/default/xui/en/floater_my_inventory.xml @@ -10,6 +10,7 @@   name="floater_my_inventory"   save_rect="true"   save_visibility="true" + reuse_instance="false"   title="INVENTORY"   width="333" >     <panel diff --git a/indra/newview/skins/default/xui/en/floater_people.xml b/indra/newview/skins/default/xui/en/floater_people.xml index 9c1d121433..32dda1b694 100644 --- a/indra/newview/skins/default/xui/en/floater_people.xml +++ b/indra/newview/skins/default/xui/en/floater_people.xml @@ -12,6 +12,7 @@    name="floater_people"    save_rect="true"    single_instance="true" +  reuse_instance="true"    title="PEOPLE"    width="333">      <panel_container diff --git a/indra/newview/skins/default/xui/en/floater_picks.xml b/indra/newview/skins/default/xui/en/floater_picks.xml index 2d307028e4..7882116662 100644 --- a/indra/newview/skins/default/xui/en/floater_picks.xml +++ b/indra/newview/skins/default/xui/en/floater_picks.xml @@ -10,6 +10,7 @@   name="floater_picks"   save_rect="true"   save_visibility="true" + reuse_instance="true"   title="Picks"   width="333" >     <panel diff --git a/indra/newview/skins/default/xui/en/floater_places.xml b/indra/newview/skins/default/xui/en/floater_places.xml index b7cb86b468..6484b54360 100644 --- a/indra/newview/skins/default/xui/en/floater_places.xml +++ b/indra/newview/skins/default/xui/en/floater_places.xml @@ -9,6 +9,7 @@    name="floater_places"    help_topic="floater_places"    save_rect="true" +  reuse_instance="true"    title="PLACES"    min_height="230"    min_width="333" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 78e10d207c..f2617556e6 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3678,7 +3678,7 @@ Try enclosing path to the editor with double quotes.    <string name="Command_Snapshot_Label">Snapshot</string>    <string name="Command_Speak_Label">Speak</string>    <string name="Command_View_Label">View</string> -  <string name="Command_Voice_Label">Nearby voice</string> +  <string name="Command_Voice_Label">Voice settings</string>    <string name="Command_AboutLand_Tooltip">Information about the land you're visiting</string>    <string name="Command_Appearance_Tooltip">Change your avatar</string> @@ -3703,7 +3703,7 @@ Try enclosing path to the editor with double quotes.    <string name="Command_Snapshot_Tooltip">Take a picture</string>    <string name="Command_Speak_Tooltip">Speak with people nearby using your microphone</string>    <string name="Command_View_Tooltip">Changing camera angle</string> -  <string name="Command_Voice_Tooltip">People nearby with voice capability</string> +  <string name="Command_Voice_Tooltip">Volume controls for calls and people near you in world</string>   <!-- Mesh UI terms -->    <string name="Retain%">Retain%</string> | 
