diff options
28 files changed, 591 insertions, 192 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 6c08ec7431..06781f1bdf 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -989,11 +989,27 @@ void LLButton::resize(LLUIString label)  	// get current btn length   	S32 btn_width =getRect().getWidth();      // check if it need resize  -	if (mAutoResize == TRUE) +	if (mAutoResize)  	{  -		if (btn_width - (mRightHPad + mLeftHPad) < label_width) +		S32 min_width = label_width + mLeftHPad + mRightHPad; +		if (mImageOverlay)  		{ -			setRect(LLRect( getRect().mLeft, getRect().mTop, getRect().mLeft + label_width + mLeftHPad + mRightHPad , getRect().mBottom)); +			switch(mImageOverlayAlignment) +			{ +			case LLFontGL::LEFT: +			case LLFontGL::RIGHT: +				min_width += mImageOverlay->getWidth() + mImgOverlayLabelSpace; +				break; +			case LLFontGL::HCENTER: +				break; +			default: +				// draw nothing +				break; +			} +		} +		if (btn_width < min_width) +		{ +			reshape(min_width, getRect().getHeight());  		}  	}   } diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 6be616b980..783990780b 100644 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -38,11 +38,18 @@  // +// LLCommandId class +// + +const LLCommandId LLCommandId::null("null command"); + +//  // LLCommand class  //  LLCommand::Params::Params()  	: function("function") +	, available_in_toybox("available_in_toybox", false)  	, icon("icon")  	, label_ref("label_ref")  	, name("name") @@ -53,9 +60,10 @@ LLCommand::Params::Params()  LLCommand::LLCommand(const LLCommand::Params& p)  	: mFunction(p.function) +	, mAvailableInToybox(p.available_in_toybox)  	, mIcon(p.icon) +	, mIdentifier(p.name)  	, mLabelRef(p.label_ref) -	, mName(p.name)  	, mParam(p.param)  	, mTooltipRef(p.tooltip_ref)  { @@ -90,26 +98,26 @@ LLCommand * LLCommandManager::getCommand(U32 commandIndex)  	return mCommands[commandIndex];  } -LLCommand * LLCommandManager::getCommand(const std::string& commandName) +LLCommand * LLCommandManager::getCommand(const LLCommandId& commandId)  { -	LLCommand * command_name_match = NULL; +	LLCommand * command_match = NULL; -	CommandIndexMap::const_iterator found = mCommandIndices.find(commandName); +	CommandIndexMap::const_iterator found = mCommandIndices.find(commandId);  	if (found != mCommandIndices.end())  	{ -		command_name_match = mCommands[found->second]; +		command_match = mCommands[found->second];  	} -	return command_name_match; +	return command_match;  }  void LLCommandManager::addCommand(LLCommand * command)  { -	mCommandIndices[command->name()] = mCommands.size(); +	mCommandIndices[command->id()] = mCommands.size();  	mCommands.push_back(command); -	llinfos << "Successfully added command: " << command->name() << llendl; +	lldebugs << "Successfully added command: " << command->id().name() << llendl;  }  //static diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h index 24378ecd62..8435d915f3 100644 --- a/indra/llui/llcommandmanager.h +++ b/indra/llui/llcommandmanager.h @@ -31,11 +31,62 @@  #include "llsingleton.h" +class LLCommand; +class LLCommandManager; + + +class LLCommandId +{ +public: +	friend class LLCommand; +	friend class LLCommandManager; + +	struct Params : public LLInitParam::Block<Params> +	{ +		Mandatory<std::string> name; + +		Params() +		:	name("name") +		{} +	}; + +	LLCommandId(const std::string& name) +		: mName(name) +	{} + +	LLCommandId(const Params& p) +	:	mName(p.name) +	{} + +	const std::string& name() const { return mName; } + +	bool operator!=(const LLCommandId& command) const +	{ +		return (mName != command.mName); +	} + +	bool operator==(const LLCommandId& command) const +	{ +		return (mName == command.mName); +	} + +	bool operator<(const LLCommandId& command) const +	{ +		return (mName < command.mName); +	} + +	static const LLCommandId null; + +private: +	std::string mName; +}; +  class LLCommand  {  public:  	struct Params : public LLInitParam::Block<Params>  	{ +		Mandatory<bool>			available_in_toybox;  		Mandatory<std::string>	function;  		Mandatory<std::string>	icon;  		Mandatory<std::string>	label_ref; @@ -48,18 +99,21 @@ public:  	LLCommand(const LLCommand::Params& p); +	const bool availableInToybox() const { return mAvailableInToybox; }  	const std::string& functionName() const { return mFunction; }  	const std::string& icon() const { return mIcon; } +	const LLCommandId& id() const { return mIdentifier; }  	const std::string& labelRef() const { return mLabelRef; } -	const std::string& name() const { return mName; }  	const std::string& param() const { return mParam; }  	const std::string& tooltipRef() const { return mTooltipRef; }  private: +	LLCommandId mIdentifier; + +	bool        mAvailableInToybox;  	std::string mFunction;  	std::string mIcon;  	std::string mLabelRef; -	std::string	mName;  	std::string mParam;  	std::string mTooltipRef;  }; @@ -84,7 +138,7 @@ public:  	U32 commandCount() const;  	LLCommand * getCommand(U32 commandIndex); -	LLCommand * getCommand(const std::string& commandName); +	LLCommand * getCommand(const LLCommandId& commandId);  	static bool load(); @@ -92,7 +146,7 @@ protected:  	void addCommand(LLCommand * command);  private: -	typedef std::map<std::string, U32>	CommandIndexMap; +	typedef std::map<LLCommandId, U32>	CommandIndexMap;  	typedef std::vector<LLCommand *>	CommandVector;  	CommandVector	mCommands; diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index 7b9084671d..6e39fcd714 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -161,7 +161,7 @@ bool LLDockControl::isDockVisible()  			case TOP:  			{  				// check is dock inside parent rect -				// assume that parent for all dockable flaoters +				// assume that parent for all dockable floaters  				// is the root view  				LLRect dockParentRect =  						mDockWidget->getRootView()->calcScreenRect(); diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 6cac841cde..badba7a416 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -947,7 +947,7 @@ LLMenuItemBranchGL::LLMenuItemBranchGL(const LLMenuItemBranchGL::Params& p)  LLMenuItemBranchGL::~LLMenuItemBranchGL()  { -	LLView::deleteViewByHandle(mBranchHandle); +	delete mBranchHandle.get();  }  // virtual diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 31a18dc707..0c3052b1ab 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -31,6 +31,7 @@  #include "lltoolbar.h"  #include "llcommandmanager.h" +#include "llmenugl.h"  #include "lltrans.h"  // uncomment this and remove the one in llui.cpp when there is an external reference to this translation unit @@ -51,6 +52,7 @@ namespace LLToolBarEnums  		return orientation;  	}  } +  using namespace LLToolBarEnums; @@ -58,8 +60,8 @@ namespace LLInitParam  {  	void TypeValues<ButtonType>::declareValues()  	{ -		declare("icons_only",		BTNTYPE_ICONS_ONLY);  		declare("icons_with_text",	BTNTYPE_ICONS_WITH_TEXT); +		declare("icons_only",		BTNTYPE_ICONS_ONLY);  	}  	void TypeValues<SideType>::declareValues() @@ -73,10 +75,11 @@ namespace LLInitParam  LLToolBar::Params::Params()  :	button_display_mode("button_display_mode"), -	buttons("button"), +	commands("command"),  	side("side", SIDE_TOP),  	button_icon("button_icon"),  	button_icon_and_text("button_icon_and_text"), +	read_only("read_only", false),  	wrap("wrap", true),  	min_button_width("min_button_width", 0),  	max_button_width("max_button_width", S32_MAX), @@ -91,6 +94,7 @@ LLToolBar::Params::Params()  LLToolBar::LLToolBar(const LLToolBar::Params& p)  :	LLUICtrl(p), +	mReadOnly(p.read_only),  	mButtonType(p.button_display_mode),  	mSideType(p.side),  	mWrap(p.wrap), @@ -104,10 +108,41 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p)  	mPadRight(p.pad_right),  	mPadTop(p.pad_top),  	mPadBottom(p.pad_bottom), -	mPadBetween(p.pad_between) +	mPadBetween(p.pad_between), +	mPopupMenuHandle()  { -	mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_ONLY] = p.button_icon;  	mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text; +	mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_ONLY] = p.button_icon; +} + +LLToolBar::~LLToolBar() +{ +	delete mPopupMenuHandle.get(); +} + +void LLToolBar::createContextMenu() +{ +	if (!mPopupMenuHandle.get()) +	{ +		LLUICtrl::CommitCallbackRegistry::Registrar& commit_reg = LLUICtrl::CommitCallbackRegistry::defaultRegistrar(); +		commit_reg.add("Toolbars.EnableSetting", boost::bind(&LLToolBar::onSettingEnable, this, _2)); + +		LLUICtrl::EnableCallbackRegistry::Registrar& enable_reg = LLUICtrl::EnableCallbackRegistry::defaultRegistrar(); +		enable_reg.add("Toolbars.CheckSetting", boost::bind(&LLToolBar::isSettingChecked, this, _2)); + +		LLContextMenu* menu = LLUICtrlFactory::instance().createFromFile<LLContextMenu>("menu_toolbars.xml", LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance()); + +		if (menu) +		{ +			menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor")); + +			mPopupMenuHandle = menu->getHandle(); +		} +		else +		{ +			llwarns << "Unable to load toolbars context menu." << llendl; +		} +	}  }  void LLToolBar::initFromParams(const LLToolBar::Params& p) @@ -122,6 +157,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p)  	centering_stack_p.rect = getLocalRect();  	centering_stack_p.follows.flags = FOLLOWS_ALL;  	centering_stack_p.orientation = orientation; +	centering_stack_p.mouse_opaque = false;  	mCenteringStack = LLUICtrlFactory::create<LLLayoutStack>(centering_stack_p);  	addChild(mCenteringStack); @@ -131,6 +167,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p)  	border_panel_p.rect = getLocalRect();  	border_panel_p.auto_resize = true;  	border_panel_p.user_resize = false; +	border_panel_p.mouse_opaque = false;  	mCenteringStack->addChild(LLUICtrlFactory::create<LLLayoutPanel>(border_panel_p)); @@ -145,58 +182,127 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p)  	LLPanel::Params button_panel_p(p.button_panel);  	button_panel_p.rect = center_panel->getLocalRect(); -	switch(p.side()) -	{ -	case SIDE_LEFT: -		button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT; -		break; -	case SIDE_RIGHT: -		button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_RIGHT; -		break; -	case SIDE_TOP: -		button_panel_p.follows.flags = FOLLOWS_TOP|FOLLOWS_LEFT; -		break; -	case SIDE_BOTTOM:  		button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT; -		break; -	}  	mButtonPanel = LLUICtrlFactory::create<LLPanel>(button_panel_p);  	center_panel->addChild(mButtonPanel);  	mCenteringStack->addChild(LLUICtrlFactory::create<LLLayoutPanel>(border_panel_p)); -	BOOST_FOREACH (LLToolBarButton::Params button_p, p.buttons) +	BOOST_FOREACH (const LLCommandId::Params& command_id, p.commands)  	{ -		button_p.fillFrom(mButtonParams[mButtonType]); -		LLToolBarButton* buttonp = LLUICtrlFactory::create<LLToolBarButton>(button_p); +		mButtonCommands.push_back(command_id); +	} +	createButtons(); + +	mNeedsLayout = true; +} + +bool LLToolBar::addCommand(const LLCommandId& commandId) +{ +	LLCommand * command = LLCommandManager::instance().getCommand(commandId); + +	bool add_command = (command != NULL); + +	mButtonCommands.push_back(commandId); +	createButtons(); -		mButtons.push_back(buttonp); -		mButtonPanel->addChild(buttonp); +	return add_command; +} + +bool LLToolBar::hasCommand(const LLCommandId& commandId) const +{ +	bool has_command = false; -		mNeedsLayout = true; +	if (commandId != LLCommandId::null) +	{ +		for (std::list<LLCommandId>::const_iterator cmd = mButtonCommands.begin(); cmd != mButtonCommands.end(); ++cmd) +		{ +			if ((*cmd) == commandId) +			{ +				has_command = true; +				break; +			} +		}  	} + +	return has_command;  } -bool LLToolBar::addCommand(LLCommand * command) +bool LLToolBar::enableCommand(const LLCommandId& commandId, bool enabled)  { -	// -	// Init basic toolbar button params -	// -	LLToolBarButton::Params button_p(mButtonParams[mButtonType]); -	button_p.name = command->name(); -	button_p.label = LLTrans::getString(command->labelRef()); -	button_p.tool_tip = LLTrans::getString(command->tooltipRef()); - -	// -	// Add it to the list of buttons -	// -	LLToolBarButton * toolbar_button = LLUICtrlFactory::create<LLToolBarButton>(button_p); -	mButtons.push_back(toolbar_button); -	mButtonPanel->addChild(toolbar_button); +	LLButton * command_button = NULL; +	 +	if (commandId != LLCommandId::null) +	{ +		command_button = mButtonPanel->findChild<LLButton>(commandId.name()); -	mNeedsLayout = true; +		if (command_button) +		{ +			command_button->setEnabled(enabled); +		} +	} -	return true; +	return (command_button != NULL); +} + +BOOL LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ +	BOOL handle_it_here = !mReadOnly; + +	if (handle_it_here) +	{ +		createContextMenu(); +		LLContextMenu * menu = (LLContextMenu *) mPopupMenuHandle.get(); + +		if (menu) +		{ +			menu->show(x, y); +			LLMenuGL::showPopup(this, menu, x, y); +		} +	} + +	return handle_it_here; +} + +BOOL LLToolBar::isSettingChecked(const LLSD& userdata) +{ +	BOOL retval = FALSE; + +	const std::string setting_name = userdata.asString(); + +	if (setting_name == "icons_and_labels") +	{ +		retval = (mButtonType == BTNTYPE_ICONS_WITH_TEXT); +	} +	else if (setting_name == "icons_only") +	{ +		retval = (mButtonType == BTNTYPE_ICONS_ONLY); +	} + +	return retval; +} + +void LLToolBar::onSettingEnable(const LLSD& userdata) +{ +	llassert(!mReadOnly); + +	const std::string setting_name = userdata.asString(); + +	const ButtonType current_button_type = mButtonType; + +	if (setting_name == "icons_and_labels") +	{ +		mButtonType = BTNTYPE_ICONS_WITH_TEXT; +	} +	else if (setting_name == "icons_only") +	{ +		mButtonType = BTNTYPE_ICONS_ONLY; +	} + +	if(current_button_type != mButtonType) +	{ +		createButtons(); +	}  }  void LLToolBar::resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row, S32 max_row_girth) @@ -241,7 +347,6 @@ void LLToolBar::updateLayoutAsNeeded()  		max_length = getRect().getWidth() - mPadLeft - mPadRight;  		max_total_girth = getRect().getHeight() - mPadTop - mPadBottom;  		row_pad_start = mPadLeft; -		row_running_length = row_pad_start;  		row_pad_end = mPadRight;  		cur_row = mPadTop;  		girth_pad_end = mPadBottom; @@ -251,12 +356,12 @@ void LLToolBar::updateLayoutAsNeeded()  		max_length = getRect().getHeight() - mPadTop - mPadBottom;  		max_total_girth = getRect().getWidth() - mPadLeft - mPadRight;  		row_pad_start = mPadTop; -		row_running_length = row_pad_start;  		row_pad_end = mPadBottom;  		cur_row = mPadLeft;  		girth_pad_end = mPadRight;  	} +	row_running_length = row_pad_start;  	cur_start = row_pad_start; @@ -329,17 +434,20 @@ void LLToolBar::updateLayoutAsNeeded()  	{  		if (mSideType == SIDE_TOP)  		{ // shift down to maintain top edge -			mButtonPanel->translate(0, mButtonPanel->getRect().getHeight() - total_girth); +			translate(0, getRect().getHeight() - total_girth);  		} +		reshape(getRect().getWidth(), total_girth);  		mButtonPanel->reshape(max_row_length, total_girth);  	}  	else // VERTICAL  	{  		if (mSideType == SIDE_RIGHT)  		{ // shift left to maintain right edge -			mButtonPanel->translate(mButtonPanel->getRect().getWidth() - total_girth, 0); +			translate(getRect().getWidth() - total_girth, 0);  		} +		 +		reshape(total_girth, getRect().getHeight());  		mButtonPanel->reshape(total_girth, max_row_length);  		} @@ -363,3 +471,29 @@ void LLToolBar::reshape(S32 width, S32 height, BOOL called_from_parent)  	mNeedsLayout = true;  } +void LLToolBar::createButtons() +{ +	BOOST_FOREACH(LLToolBarButton* button, mButtons) +	{ +		delete button; +	} +	mButtons.clear(); +	 +	BOOST_FOREACH(LLCommandId& command_id, mButtonCommands) +	{ +		LLCommand* commandp = LLCommandManager::instance().getCommand(command_id); +		if (!commandp) continue; + +		LLToolBarButton::Params button_p; +		button_p.label = LLTrans::getString(commandp->labelRef()); +		button_p.image_overlay = LLUI::getUIImage(commandp->icon()); +		button_p.overwriteFrom(mButtonParams[mButtonType]); +		LLToolBarButton* button = LLUICtrlFactory::create<LLToolBarButton>(button_p); + +		mButtons.push_back(button); +		mButtonPanel->addChild(button); +	} + +	mNeedsLayout = true; +} + diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 92c289cd3f..75ae499a3d 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -28,12 +28,11 @@  #ifndef LL_LLTOOLBAR_H  #define LL_LLTOOLBAR_H -#include "lluictrl.h" -#include "lllayoutstack.h"  #include "llbutton.h" - - -class LLCommand; +#include "llcommandmanager.h" +#include "lllayoutstack.h" +#include "lluictrl.h" +#include "llcommandmanager.h"  class LLToolBarButton : public LLButton @@ -51,8 +50,8 @@ namespace LLToolBarEnums  {  	enum ButtonType  	{ -		BTNTYPE_ICONS_ONLY = 0, -		BTNTYPE_ICONS_WITH_TEXT, +		BTNTYPE_ICONS_WITH_TEXT = 0, +		BTNTYPE_ICONS_ONLY,  		BTNTYPE_COUNT  	}; @@ -96,7 +95,9 @@ public:  		Optional<LLToolBarButton::Params>		button_icon,  												button_icon_and_text; -		Optional<bool>							wrap; +		Optional<bool>							read_only, +												wrap; +  		Optional<S32>							min_button_width,  												max_button_width,  												button_height; @@ -107,7 +108,7 @@ public:  												pad_bottom,  												pad_between;  		// get rid of this -		Multiple<LLToolBarButton::Params>		buttons; +		Multiple<LLCommandId::Params>			commands;  		Optional<LLPanel::Params>				button_panel; @@ -117,20 +118,31 @@ public:  	// virtuals  	void draw();  	void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); +	BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); -	bool addCommand(LLCommand * command); +	bool addCommand(const LLCommandId& commandId); +	bool hasCommand(const LLCommandId& commandId) const; +	bool enableCommand(const LLCommandId& commandId, bool enabled);  protected:  	friend class LLUICtrlFactory;  	LLToolBar(const Params&); +	~LLToolBar();  	void initFromParams(const Params&);  private: +	void createContextMenu();  	void updateLayoutAsNeeded(); +	void createButtons();  	void resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row, S32 max_row_girth); +	BOOL isSettingChecked(const LLSD& userdata); +	void onSettingEnable(const LLSD& userdata); + +	const bool						mReadOnly;  	std::list<LLToolBarButton*>		mButtons; +	std::list<LLCommandId>			mButtonCommands;  	LLToolBarEnums::ButtonType		mButtonType;  	LLLayoutStack*					mCenteringStack;  	LLLayoutStack*					mWrapStack; @@ -149,6 +161,8 @@ private:  									mPadBetween;  	LLToolBarButton::Params			mButtonParams[LLToolBarEnums::BTNTYPE_COUNT]; + +	LLHandle<class LLContextMenu>			mPopupMenuHandle;  }; diff --git a/indra/llui/lltoolbarview.cpp b/indra/llui/lltoolbarview.cpp index c99b573b35..9df6f4946f 100644 --- a/indra/llui/lltoolbarview.cpp +++ b/indra/llui/lltoolbarview.cpp @@ -37,7 +37,10 @@ LLToolBarView* gToolBarView = NULL;  static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view");  LLToolBarView::LLToolBarView(const LLToolBarView::Params& p) -:	LLUICtrl(p) +:	LLUICtrl(p), +	mToolbarLeft(NULL), +	mToolbarRight(NULL), +	mToolbarBottom(NULL)  {  } @@ -51,21 +54,46 @@ LLToolBarView::~LLToolBarView()  {  } +BOOL LLToolBarView::postBuild() +{ +	mToolbarLeft   = getChild<LLToolBar>("toolbar_left"); +	mToolbarRight  = getChild<LLToolBar>("toolbar_right"); +	mToolbarBottom = getChild<LLToolBar>("toolbar_bottom"); +	return TRUE; +} + +bool LLToolBarView::hasCommand(const LLCommandId& commandId) const +{ +	bool has_command = false; +	if (mToolbarLeft && !has_command) +	{ +		has_command = mToolbarLeft->hasCommand(commandId); +	} +	if (mToolbarRight && !has_command) +	{ +		has_command = mToolbarRight->hasCommand(commandId); +	} +	if (mToolbarBottom && !has_command) +	{ +		has_command = mToolbarBottom->hasCommand(commandId); +	} +	return has_command; +} +  void LLToolBarView::draw()  {  	static bool debug_print = true;  	static S32 old_width = 0;  	static S32 old_height = 0; -	LLToolBar* toolbar_bottom = getChild<LLToolBar>("toolbar_bottom"); -	LLToolBar* toolbar_left = getChild<LLToolBar>("toolbar_left"); -	LLToolBar* toolbar_right = getChild<LLToolBar>("toolbar_right"); -	LLPanel* sizer_left = getChild<LLPanel>("sizer_left"); +	//LLPanel* sizer_left = getChild<LLPanel>("sizer_left"); +	 +	LLRect bottom_rect, left_rect, right_rect; + +	if (mToolbarBottom) mToolbarBottom->localRectToOtherView(mToolbarBottom->getLocalRect(), &bottom_rect, this); +	if (mToolbarLeft)   mToolbarLeft->localRectToOtherView(mToolbarLeft->getLocalRect(), &left_rect, this); +	if (mToolbarRight)  mToolbarRight->localRectToOtherView(mToolbarRight->getLocalRect(), &right_rect, this); -	LLRect bottom_rect = toolbar_bottom->getRect(); -	LLRect left_rect = toolbar_left->getRect(); -	LLRect right_rect = toolbar_right->getRect(); -	LLRect sizer_left_rect = sizer_left->getRect();  	if ((old_width != getRect().getWidth()) || (old_height != getRect().getHeight()))  		debug_print = true; @@ -76,18 +104,21 @@ void LLToolBarView::draw()  		llinfos << "Merov debug : draw bottom  rect = " << bottom_rect.mLeft << ", " << bottom_rect.mTop << ", " << bottom_rect.mRight << ", " << bottom_rect.mBottom << llendl;   		llinfos << "Merov debug : draw left    rect = " << left_rect.mLeft << ", " << left_rect.mTop << ", " << left_rect.mRight << ", " << left_rect.mBottom << llendl;   		llinfos << "Merov debug : draw right   rect = " << right_rect.mLeft << ", " << right_rect.mTop << ", " << right_rect.mRight << ", " << right_rect.mBottom << llendl;  -		llinfos << "Merov debug : draw s left  rect = " << sizer_left_rect.mLeft << ", " << sizer_left_rect.mTop << ", " << sizer_left_rect.mRight << ", " << sizer_left_rect.mBottom << llendl;   		old_width = ctrl_rect.getWidth();  		old_height = ctrl_rect.getHeight();  		debug_print = false;  	}  	// Debug draw  	LLColor4 back_color = LLColor4::blue; +	LLColor4 back_color_vert = LLColor4::red; +	LLColor4 back_color_hori = LLColor4::yellow;  	back_color[VALPHA] = 0.5f; +	back_color_hori[VALPHA] = 0.5f; +	back_color_vert[VALPHA] = 0.5f;  	//gl_rect_2d(getLocalRect(), back_color, TRUE); -	//gl_rect_2d(bottom_rect, LLColor4::red, TRUE); -	//gl_rect_2d(left_rect, LLColor4::green, TRUE); -	//gl_rect_2d(right_rect, LLColor4::yellow, TRUE); +	gl_rect_2d(bottom_rect, back_color_hori, TRUE); +	gl_rect_2d(left_rect, back_color_vert, TRUE); +	gl_rect_2d(right_rect, back_color_vert, TRUE);  	LLUICtrl::draw();  } diff --git a/indra/llui/lltoolbarview.h b/indra/llui/lltoolbarview.h index 0e6545015d..2e7885f391 100644 --- a/indra/llui/lltoolbarview.h +++ b/indra/llui/lltoolbarview.h @@ -29,6 +29,8 @@  #define LL_LLTOOLBARVIEW_H  #include "lluictrl.h" +#include "lltoolbar.h" +#include "llcommandmanager.h"  class LLUICtrlFactory; @@ -38,9 +40,14 @@ class LLToolBarView : public LLUICtrl  {  public:  	struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> {}; +	  	virtual ~LLToolBarView(); +	/*virtual*/ BOOL postBuild(); +  	virtual void draw(); +	bool hasCommand(const LLCommandId& commandId) const; +	  	// valid children for LLToolBarView are stored in this registry  	typedef LLDefaultChildRegistry child_registry_t; @@ -51,7 +58,9 @@ protected:  	void initFromParams(const Params&);  private: -	LLHandle<LLView>	mSnapView; +	LLToolBar*	mToolbarLeft; +	LLToolBar*	mToolbarRight; +	LLToolBar*	mToolbarBottom;  };  extern LLToolBarView* gToolBarView; diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 60452b9ae4..e10c2f0d1e 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1826,13 +1826,6 @@ LLView* LLView::findNextSibling(LLView* child)  	return (next_it != mChildList.end()) ? *next_it : NULL;  } -void LLView::deleteViewByHandle(LLHandle<LLView> handle) -{ -	LLView* viewp = handle.get(); - -	delete viewp; -} -  LLCoordGL getNeededTranslation(const LLRect& input, const LLRect& constraint, BOOL allow_partial_outside)  { diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 43986a3a84..9039366e7e 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -480,7 +480,6 @@ public:  	// return query for iterating over focus roots in tab order  	static const LLCtrlQuery & getFocusRootsQuery(); -	static void deleteViewByHandle(LLHandle<LLView> handle);  	static LLWindow*	getWindow(void) { return LLUI::sWindow; }  	// Set up params after XML load before calling new(), diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 5cb8ddffcd..4a33b24075 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -1,6 +1,7 @@  <?xml version="1.0" encoding="utf-8" standalone="yes" ?>  <commands>    <command name="avatar" +           available_in_toybox="true"             icon="Command_Avatar_Icon"             label_ref="Command_Avatar_Label"             tooltip_ref="Command_Avatar_Tooltip" @@ -8,6 +9,7 @@             param="avatar"             />    <command name="build" +           available_in_toybox="true"             icon="Command_Build_Icon"             label_ref="Command_Build_Label"             tooltip_ref="Command_Build_Tooltip" @@ -15,6 +17,7 @@             param="build"             />    <command name="chat" +           available_in_toybox="true"             icon="Command_Chat_Icon"             label_ref="Command_Chat_Label"             tooltip_ref="Command_Chat_Tooltip" @@ -22,6 +25,7 @@             param="chat"             />    <command name="compass" +           available_in_toybox="false"             icon="Command_Compass_Icon"             label_ref="Command_Compass_Label"             tooltip_ref="Command_Compass_Tooltip" @@ -29,6 +33,7 @@             param="compass"             />    <command name="gestures" +           available_in_toybox="true"             icon="Command_Gestures_Icon"             label_ref="Command_Gestures_Label"             tooltip_ref="Command_Gestures_Tooltip" @@ -36,6 +41,7 @@             param="gestures"             />    <command name="howto" +           available_in_toybox="true"             icon="Command_HowTo_Icon"             label_ref="Command_HowTo_Label"             tooltip_ref="Command_HowTo_Tooltip" @@ -43,6 +49,7 @@             param="howto"             />    <command name="landmarks" +           available_in_toybox="true"             icon="Command_Landmarks_Icon"             label_ref="Command_Landmarks_Label"             tooltip_ref="Command_Landmarks_Tooltip" @@ -50,13 +57,23 @@             param="landmarks"             />    <command name="map" +           available_in_toybox="true"             icon="Command_Map_Icon"             label_ref="Command_Map_Label"             tooltip_ref="Command_Map_Tooltip"             function="Floater.ToolbarToggle"             param="map"             /> +  <command name="minimap" +           available_in_toybox="true" +           icon="Command_MiniMap_Icon" +           label_ref="Command_MiniMap_Label" +           tooltip_ref="Command_MiniMap_Tooltip" +           function="Floater.ToolbarToggle" +           param="minimap" +           />    <command name="move" +           available_in_toybox="true"             icon="Command_Move_Icon"             label_ref="Command_Move_Label"             tooltip_ref="Command_Move_Tooltip" @@ -64,6 +81,7 @@             param="move"             />    <command name="myland" +           available_in_toybox="true"             icon="Command_MyLand_Icon"             label_ref="Command_MyLand_Label"             tooltip_ref="Command_MyLand_Tooltip" @@ -71,6 +89,7 @@             param="myland"             />    <command name="mystuff" +           available_in_toybox="true"             icon="Command_MyStuff_Icon"             label_ref="Command_MyStuff_Label"             tooltip_ref="Command_MyStuff_Tooltip" @@ -78,6 +97,7 @@             param="mystuff"             />    <command name="people" +           available_in_toybox="true"             icon="Command_People_Icon"             label_ref="Command_People_Label"             tooltip_ref="Command_People_Tooltip" @@ -85,6 +105,7 @@             param="people"             />    <command name="places" +           available_in_toybox="true"             icon="Command_Places_Icon"             label_ref="Command_Places_Label"             tooltip_ref="Command_Places_Tooltip" @@ -92,6 +113,7 @@             param="places"             />    <command name="search" +           available_in_toybox="true"             icon="Command_Search_Icon"             label_ref="Command_Search_Label"             tooltip_ref="Command_Search_Tooltip" @@ -99,6 +121,7 @@             param="search"             />    <command name="settings" +           available_in_toybox="true"             icon="Command_Settings_Icon"             label_ref="Command_Settings_Label"             tooltip_ref="Command_Settings_Tooltip" @@ -106,6 +129,7 @@             param="settings"             />    <command name="shop" +           available_in_toybox="true"             icon="Command_Shop_Icon"             label_ref="Command_Shop_Label"             tooltip_ref="Command_Shop_Tooltip" @@ -113,6 +137,7 @@             param="shop"             />    <command name="snapshot" +           available_in_toybox="true"             icon="Command_Snapshot_Icon"             label_ref="Command_Snapshot_Label"             tooltip_ref="Command_Snapshot_Tooltip" @@ -120,6 +145,7 @@             param="snapshot"             />    <command name="speak" +           available_in_toybox="true"             icon="Command_Speak_Icon"             label_ref="Command_Speak_Label"             tooltip_ref="Command_Speak_Tooltip" @@ -127,6 +153,7 @@             param="speak"             />    <command name="upload" +           available_in_toybox="true"             icon="Command_Upload_Icon"             label_ref="Command_Upload_Label"             tooltip_ref="Command_Upload_Tooltip" @@ -134,6 +161,7 @@             param="upload"             />    <command name="view" +           available_in_toybox="true"             icon="Command_View_Icon"             label_ref="Command_View_Label"             tooltip_ref="Command_View_Tooltip" diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f1db72e5cc..9a06423422 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1858,7 +1858,7 @@      <key>Type</key>      <string>Boolean</string>      <key>Value</key> -    <integer>1</integer> +    <integer>0</integer>    </map>      <key>Cursor3D</key>      <map> diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 0b17d64eb0..836c580ea8 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -403,8 +403,8 @@ LLFavoritesBarCtrl::~LLFavoritesBarCtrl()  {  	gInventory.removeObserver(this); -	LLView::deleteViewByHandle(mOverflowMenuHandle); -	LLView::deleteViewByHandle(mContextMenuHandle); +	delete mOverflowMenuHandle.get(); +	delete mContextMenuHandle.get();  }  BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 00dc7b1627..9d020517d8 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -2112,7 +2112,7 @@ LLFloaterSnapshot::LLFloaterSnapshot(const LLSD& key)  // Destroys the object  LLFloaterSnapshot::~LLFloaterSnapshot()  { -	LLView::deleteViewByHandle(impl.mPreviewHandle); +	delete impl.mPreviewHandle.get();  	//unfreeze everything else  	gSavedSettings.setBOOL("FreezeTime", FALSE); diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp index eaaaeb3357..beb928ea36 100644 --- a/indra/newview/llfloatertoybox.cpp +++ b/indra/newview/llfloatertoybox.cpp @@ -32,6 +32,7 @@  #include "llcommandmanager.h"  #include "llpanel.h"  #include "lltoolbar.h" +#include "lltoolbarview.h"  LLFloaterToybox::LLFloaterToybox(const LLSD& key) @@ -63,7 +64,13 @@ BOOL LLFloaterToybox::postBuild()  	{  		LLCommand * command = cmdMgr.getCommand(i); -		mToolBar->addCommand(command); +		if (command->availableInToybox()) +		{ +			mToolBar->addCommand(command->id()); + +			llassert(gToolBarView != NULL); +			mToolBar->enableCommand(command->id(), !gToolBarView->hasCommand(command->id())); +		}  	}  	return TRUE; diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 9ba5f827e2..6ec2598e44 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -299,7 +299,7 @@ LLFolderView::~LLFolderView( void )  	mAutoOpenItems.removeAllNodes();  	gIdleCallbacks.deleteFunction(idle, this); -	LLView::deleteViewByHandle(mPopupMenuHandle); +	delete mPopupMenuHandle.get();  	mAutoOpenItems.removeAllNodes();  	clearSelection(); @@ -1969,7 +1969,7 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,  void LLFolderView::deleteAllChildren()  {  	closeRenamer(); -	LLView::deleteViewByHandle(mPopupMenuHandle); +	delete mPopupMenuHandle.get();  	mPopupMenuHandle = LLHandle<LLView>();  	mScrollContainer = NULL;  	mRenameItem = NULL; diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index c3e6e1c2dc..f7ed1116cb 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -95,7 +95,7 @@ LLGroupList::LLGroupList(const Params& p)  LLGroupList::~LLGroupList()  {  	gAgent.removeListener(this); -	LLView::deleteViewByHandle(mContextMenuHandle); +	delete mContextMenuHandle.get();  }  // virtual diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e3a7b749ea..177aa4f5c8 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -526,11 +526,11 @@ LLPanelPeople::~LLPanelPeople()  		LLVoiceClient::getInstance()->removeObserver(this);  	} -	LLView::deleteViewByHandle(mGroupPlusMenuHandle); -	LLView::deleteViewByHandle(mNearbyViewSortMenuHandle); -	LLView::deleteViewByHandle(mFriendsViewSortMenuHandle); -	LLView::deleteViewByHandle(mGroupsViewSortMenuHandle); -	LLView::deleteViewByHandle(mRecentViewSortMenuHandle); +	delete mGroupPlusMenuHandle.get(); +	delete mNearbyViewSortMenuHandle.get(); +	delete mFriendsViewSortMenuHandle.get(); +	delete mGroupsViewSortMenuHandle.get(); +	delete mRecentViewSortMenuHandle.get();  } diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 9b35e78134..dfa8c75493 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -388,7 +388,7 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel()  LLTeleportHistoryPanel::~LLTeleportHistoryPanel()  {  	LLTeleportHistoryFlatItemStorage::instance().purge(); -	LLView::deleteViewByHandle(mGearMenuHandle); +	delete mGearMenuHandle.get();  }  BOOL LLTeleportHistoryPanel::postBuild() diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 947f0ec184..6d69932e93 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1779,7 +1779,7 @@ void LLViewerWindow::initBase()  	mHintHolder = main_view->getChild<LLView>("hint_holder")->getHandle();  	mLoginPanelHolder = main_view->getChild<LLView>("login_panel_holder")->getHandle(); -	// Update the toolbar global holder +	// Create the toolbar view  	// *TODO: Eventually, suppress the existence of this debug setting and turn toolbar FUI on permanently  	if (gSavedSettings.getBOOL("DebugToolbarFUI"))  	{ @@ -1787,8 +1787,9 @@ void LLViewerWindow::initBase()  		LLPanel* panel_holder = main_view->getChild<LLPanel>("toolbar_view_holder");  		// Load the toolbar view from file   		gToolBarView = LLUICtrlFactory::getInstance()->createFromFile<LLToolBarView>("panel_toolbar_view.xml", panel_holder, LLDefaultChildRegistry::instance()); -		// Attach it to the toolbar view holder -		//panel_holder->addChild(gToolBarView); +		gToolBarView->setShape(panel_holder->getLocalRect()); +		// Hide the toolbars for the moment: we'll make them visible after logging in world (see LLViewerWindow::initWorldUI()) +		gToolBarView->setVisible(FALSE);  	}  	// Constrain floaters to inside the menu and status bar regions. @@ -1953,6 +1954,12 @@ void LLViewerWindow::initWorldUI()  	buttons_panel->setShape(buttons_panel_container->getLocalRect());  	buttons_panel->setFollowsAll();  	buttons_panel_container->addChild(buttons_panel); + +	// Make the toolbars visible +	if (gToolBarView) +	{ +		gToolBarView->setVisible(TRUE); +	}  }  // Destroy the UI diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index d68594097c..be68c2873e 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -133,6 +133,7 @@ with the same filename but different name    <texture name="Command_HowTo_Icon"     file_name="icons/SL_Logo.png" preload="true" />    <texture name="Command_Landmarks_Icon" file_name="icons/SL_Logo.png" preload="true" />    <texture name="Command_Map_Icon"       file_name="icons/SL_Logo.png" preload="true" /> +  <texture name="Command_MiniMap_Icon"   file_name="icons/SL_Logo.png" preload="true" />    <texture name="Command_Move_Icon"      file_name="icons/SL_Logo.png" preload="true" />    <texture name="Command_MyLand_Icon"    file_name="icons/SL_Logo.png" preload="true" />    <texture name="Command_MyStuff_Icon"   file_name="icons/SL_Logo.png" preload="true" /> @@ -758,4 +759,27 @@ with the same filename but different name    <texture name="Yellow_Gradient" file_name="windows/yellow_gradient.png"/>    <texture name="Popup_Caution" file_name="icons/pop_up_caution.png"/>    <texture name="Camera_Drag_Dot" file_name="world/CameraDragDot.png"/> + +  <texture name="Command_Avatar_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Build_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Chat_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Compass_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Gestures_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_HowTo_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Landmarks_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Map_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_MiniMap_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Move_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_MyLand_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_MyStuff_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_People_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Places_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Search_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Settings_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Shop_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Snapshot_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Speak_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_Upload_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  <texture name="Command_View_Icon" file_name="taskpanel/TabIcon_Home_Off.png"/> +  </textures> diff --git a/indra/newview/skins/default/xui/en/floater_test_toolbar.xml b/indra/newview/skins/default/xui/en/floater_test_toolbar.xml index b58c006b3f..fbfbe51a69 100644 --- a/indra/newview/skins/default/xui/en/floater_test_toolbar.xml +++ b/indra/newview/skins/default/xui/en/floater_test_toolbar.xml @@ -16,14 +16,9 @@             min_button_width="0"             max_button_width="100"             side="top"> -    <button auto_resize="true" -            use_ellipses="true" -            label="Button"/> -    <button auto_resize="true" -            label="Button with long label"/> -    <button auto_resize="true" -            use_ellipses="true" -            label="Button with longest label of all"/> +    <command name="avatar"/> +    <command name="build"/> +    <command name="chat"/>    </toolbar>    <toolbar name="test_toolbar_left"             follows="left|bottom|top" @@ -33,12 +28,9 @@             top="70"             min_button_width="100"                        side="left"> -    <button height="30" -            label="Button"/> -    <button height="50" -            label="Button with long label"/> -    <button height="60" -            label="Button with longest label of all"/> +    <command name="avatar"/> +    <command name="build"/> +    <command name="chat"/>    </toolbar>    <toolbar name="test_toolbar_right"             follows="right|bottom|top" @@ -47,12 +39,9 @@             right="500"             top="70"             side="right"> -    <button auto_resize="true" -            label="Button 1"/> -    <button auto_resize="true" -            label="Button with long label"/> -    <button auto_resize="true" -            label="Button with longest label of all"/> +    <command name="avatar"/> +    <command name="build"/> +    <command name="chat"/>    </toolbar>    <toolbar name="test_toolbar_bottom"             follows="left|right|bottom" @@ -62,11 +51,8 @@             bottom="500"             min_button_width="100"             side="bottom"> -    <button auto_resize="true" -            label="Button"/> -    <button auto_resize="true" -            label="Button with long label"/> -    <button auto_resize="true" -            label="Button with longest label of all"/> +    <command name="avatar"/> +    <command name="build"/> +    <command name="chat"/>    </toolbar>  </floater> diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml index 5f3a59d964..60a39b0bff 100644 --- a/indra/newview/skins/default/xui/en/floater_toybox.xml +++ b/indra/newview/skins/default/xui/en/floater_toybox.xml @@ -14,17 +14,17 @@    save_rect="true"    single_instance="true"    title="Customize toolbars" -  width="658"> +  width="650">    <text      follows="left|top"      font="SansSerifMedium"      halign="left"      height="20"      layout="topleft" -    left="40" +    left="20"      length="1"      name="toybox label 1" -    right="-40" +    right="-20"      top="35"      type="string">        Add or remove buttons by dragging them to or from the toolbars. @@ -35,21 +35,28 @@      halign="left"      height="20"      layout="topleft" -    left="40" +    left="20"      length="1"      name="toybox label 2" -    right="-40" +    right="-20"      top="55"      type="string">        Buttons will appear as shown or as icon-only depending on each toolbar's settings.    </text>    <toolbar      bottom="395" -    left="40" +    button_display_mode="icons_with_text" +    left="20"      max_button_width="140" -    min_button_width="140" +    min_button_width="70"      name="toybox_toolbar" -    right="-40" +    pad_left="5" +    pad_right="5" +    pad_top="5" +    pad_bottom="5" +    pad_between="15" +    read_only="true" +    right="-20"      side="top"      top="85">    </toolbar> @@ -59,7 +66,7 @@      label="Restore defaults"      label_selected="Restore defaults"      layout="topleft" -    left="40" +    left="20"      name="btn_restore_defaults"      top="415"      width="130"> diff --git a/indra/newview/skins/default/xui/en/menu_toolbars.xml b/indra/newview/skins/default/xui/en/menu_toolbars.xml new file mode 100644 index 0000000000..de13fec670 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_toolbars.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<context_menu +      layout="topleft" +      name="Toolbars Popup" +      visible="false"> +  <menu_item_call label="Choose buttons..." +                  layout="topleft" +                  name="Chose Buttons"> +    <menu_item_call.on_click function="Floater.Show" +                             parameter="toybox" /> +  </menu_item_call> +  <menu_item_separator layout="topleft" /> +  <menu_item_check label="Icons and labels" +                   layout="topleft" +                   name="icons_and_labels"> +    <on_click function="Toolbars.EnableSetting" +              parameter="icons_and_labels" /> +    <on_check function="Toolbars.CheckSetting" +              parameter="icons_and_labels" /> +  </menu_item_check> +  <menu_item_check label="Icons only" +                   layout="topleft" +                   name="icons_only"> +    <on_click function="Toolbars.EnableSetting" +              parameter="icons_only" /> +    <on_check function="Toolbars.CheckSetting" +              parameter="icons_only" /> +  </menu_item_check> +</context_menu> diff --git a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml index 12c442d8f1..23ea516b86 100644 --- a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml +++ b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml @@ -10,48 +10,96 @@   mouse_opaque="false"   tab_stop="false"   visible="true"> - <toolbar -  follows="top|bottom|left" -  layout="topleft" -  name="toolbar_left" -  height="500" -  width="30" -  left="0" -  top="0"  -  side="left" -  visible="true" /> - <toolbar -  follows="right|bottom|left" -  layout="topleft" -  name="toolbar_bottom" -  height="30" -  width="964" -  left="30" -  top="470"  -  side="bottom" -  visible="true" /> - <toolbar -  follows="top|bottom|right" -  layout="topleft" -  name="toolbar_right" -  height="500" -  width="30" -  left="994" -  top="0"  -  side="right" -  visible="true" /> - <panel -  follows="top|bottom|left" -  layout="topleft" -  name="sizer_left" -  height="500" -  width="30" -  left="0" -  top="0"  -  background_opaque="false" -  border_visible="false" -  background_visible="true" -  bg_opaque_image="Toast_Over" -  bg_alpha_image="Toast_Background" -  visible="true" /> +  <layout_stack name="bottom_toolbar_stack" +                orientation="vertical" +                left="0" +                top="0" +                width="1024" +                height="500" +                follows="all" +                mouse_opaque="false"> +  <layout_panel name="vertical_toolbar_panel" +                auto_resize="true" +                user_resize="false" +                width="1024" +                height="500" +                mouse_opaque="false"> +    <layout_stack name="vertical_toolbar_stack" +                  orientation="horizontal" +                  left="0" +                  top="0" +                  width="1024" +                  height="500" +                  follows="all" +                  mouse_opaque="false"> +      <layout_panel name="left_toolbar_panel" +                    fit_content="true" +                    auto_resize="false" +                    user_resize="false" +                    height="500" +                    width="30" +                    mouse_opaque="false"> +        <toolbar follows="left|top|bottom" +                 name="toolbar_left" +                 height="500" +                 width="30" +                 left="0" +                 top="0" +                 side="left" +                 button_display_mode="icons_only"> +          <command name="avatar"/> +          <command name="build"/> +          <command name="chat"/> +        </toolbar> +      </layout_panel> +      <layout_panel name="non_toolbar_panel" +                    auto_resize="true" +                    user_resize="false" +                    mouse_opaque="false"/> +      <layout_panel name="right_toolbar_panel" +                    fit_content="true" +                    auto_resize="false" +                    user_resize="false" +                    height="500" +                    width="30" +                    mouse_opaque="false"> +        <toolbar +          follows="right|top|bottom" +          name="toolbar_right" +          height="500" +          width="30" +          left="0" +          top="0" +          side="right" +          button_display_mode="icons_only"> +          <command name="avatar"/> +          <command name="build"/> +          <command name="chat"/> +        </toolbar> +      </layout_panel> +    </layout_stack> +  </layout_panel> +  <layout_panel name="bottom_toolbar_panel" +                fit_content="true" +                auto_resize="false" +                user_resize="false" +                height="30" +                width="1024" +                mouse_opaque="false"> +    <toolbar layout="topleft" +             name="toolbar_bottom" +             height="30" +             width="1024" +             left="0" +             top="0" +             side="bottom" +             follows="left|right|bottom" +             button_display_mode="icons_with_text" +             visible="true"> +      <command name="avatar"/> +      <command name="build"/> +      <command name="chat"/> +    </toolbar> +  </layout_panel> +  </layout_stack>  </toolbar_view> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index d4c2bc50ca..feea555fdc 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3668,6 +3668,8 @@ Try enclosing path to the editor with double quotes.    <string name="Command_Landmarks_Tooltip"></string>    <string name="Command_Map_Label">Map</string>    <string name="Command_Map_Tooltip"></string> +  <string name="Command_MiniMap_Label">Mini Map</string> +  <string name="Command_MiniMap_Tooltip"></string>    <string name="Command_Move_Label">Move</string>    <string name="Command_Move_Tooltip"></string>    <string name="Command_MyLand_Label">My Land</string> diff --git a/indra/newview/skins/default/xui/en/widgets/toolbar.xml b/indra/newview/skins/default/xui/en/widgets/toolbar.xml index 45210277b2..32bc88cc9a 100644 --- a/indra/newview/skins/default/xui/en/widgets/toolbar.xml +++ b/indra/newview/skins/default/xui/en/widgets/toolbar.xml @@ -4,17 +4,20 @@           pad_right="5"           pad_top="5"           pad_bottom="5" -         pad_between="5"> - +         pad_between="5" +         mouse_opaque="false" +         read_only="false">    <button_panel name="button_panel"                  bg_opaque_image="Rounded_Rect"                  background_visible="true"                  background_opaque="true"/>    <button_icon_and_text follows="left|top"                          chrome="true" +                        image_overlay_alignment="left"                          use_ellipses="true"                          auto_resize="true"/>    <button_icon follows="left|top" +               label=""                 chrome="true"                 use_ellipses="true"                 auto_resize="true"/>  | 
