diff options
| author | Richard Linden <none@none> | 2010-09-28 17:24:38 -0700 | 
|---|---|---|
| committer | Richard Linden <none@none> | 2010-09-28 17:24:38 -0700 | 
| commit | 633e8f44d9c329ca09c91963d53854e14136f537 (patch) | |
| tree | eb49607b353551145b0e75419a46c9f071158a29 | |
| parent | b2ebf4c245fa4b5024c6c2bee46c426ad58cb14c (diff) | |
| parent | 51ad14db881a68722530d54b5ac799a49f11264b (diff) | |
merge
| -rw-r--r-- | indra/llui/llmenugl.cpp | 8 | ||||
| -rw-r--r-- | indra/llui/llpanel.cpp | 2 | ||||
| -rw-r--r-- | indra/llui/llview.cpp | 3 | ||||
| -rw-r--r-- | indra/llui/llview.h | 3 | ||||
| -rw-r--r-- | indra/newview/app_settings/settings.xml | 24 | ||||
| -rw-r--r-- | indra/newview/llbottomtray.cpp | 52 | ||||
| -rw-r--r-- | indra/newview/llbottomtray.h | 9 | ||||
| -rw-r--r-- | indra/newview/llfloatercamera.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/llnavigationbar.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/llpanellogin.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llsidetray.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/lltool.cpp | 8 | ||||
| -rw-r--r-- | indra/newview/lltoolpie.cpp | 16 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_bottomtray.xml | 1 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml | 1 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_login.xml | 1 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_navigation_bar.xml | 1 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/widgets/sidetray_tab.xml | 4 | 
18 files changed, 97 insertions, 46 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 87f01cf44f..67993988fe 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -2596,6 +2596,7 @@ LLMenuItemGL* LLMenuGL::getHighlightedItem()  LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disabled)  { +	if (mItems.empty()) return NULL;  	// highlighting first item on a torn off menu is the  	// same as giving focus to it  	if (!cur_item && getTornOff()) @@ -2674,6 +2675,8 @@ LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disa  LLMenuItemGL* LLMenuGL::highlightPrevItem(LLMenuItemGL* cur_item, BOOL skip_disabled)  { +	if (mItems.empty()) return NULL; +  	// highlighting first item on a torn off menu is the  	// same as giving focus to it  	if (!cur_item && getTornOff()) @@ -2986,6 +2989,11 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)  	const S32 CURSOR_HEIGHT = 22;		// Approximate "normal" cursor size  	const S32 CURSOR_WIDTH = 12; +	if(menu->getChildList()->empty()) +	{ +		return; +	} +  	// Save click point for detecting cursor moves before mouse-up.  	// Must be in local coords to compare with mouseUp events.  	// If the mouse doesn't move, the menu will stay open ala the Mac. diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index c8e56630f1..d0aba2733f 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -434,7 +434,7 @@ void LLPanel::initFromParams(const LLPanel::Params& p)      //and LLView::initFromParams will use them to set visible and enabled    	setVisible(p.visible);  	setEnabled(p.enabled); - +	setFocusRoot(p.focus_root);  	setSoundFlags(p.sound_flags);  	 // control_name, tab_stop, focus_lost_callback, initial_value, rect, enabled, visible diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 6ac009956d..267640a226 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -102,6 +102,7 @@ LLView::Params::Params()  	left_pad("left_pad"),  	left_delta("left_delta", S32_MAX),  	from_xui("from_xui", false), +	focus_root("focus_root", false),  	needs_translate("translate"),  	xmlns("xmlns"),  	xmlns_xsi("xmlns:xsi"), @@ -117,7 +118,7 @@ LLView::LLView(const LLView::Params& p)  	mParentView(NULL),  	mReshapeFlags(FOLLOWS_NONE),  	mFromXUI(p.from_xui), -	mIsFocusRoot(FALSE), +	mIsFocusRoot(p.focus_root),  	mLastVisible(FALSE),  	mNextInsertionOrdinal(0),  	mHoverCursor(getCursorFromString(p.hover_cursor)), diff --git a/indra/llui/llview.h b/indra/llui/llview.h index e6e0a41962..654e99563e 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -116,7 +116,8 @@ public:  									visible,  									mouse_opaque,  									use_bounding_rect, -									from_xui; +									from_xui, +									focus_root;  		Optional<S32>				tab_group,  									default_tab_group; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9c19d2c638..18a064c7ba 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2820,6 +2820,28 @@        <key>Value</key>        <integer>1</integer>      </map> +    <key>EnableGrab</key> +    <map> +      <key>Comment</key> +      <string>Use Ctrl+mouse to grab and manipulate objects</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>Boolean</string> +      <key>Value</key> +      <integer>1</integer> +    </map> +    <key>EnableAltZoom</key> +    <map> +      <key>Comment</key> +      <string>Use Alt+mouse to look at and zoom in on objects</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>Boolean</string> +      <key>Value</key> +      <integer>1</integer> +    </map>      <key>EnableRippleWater</key>      <map>        <key>Comment</key> @@ -11684,7 +11706,7 @@        <string>Boolean</string>        <key>Value</key>        <integer>1</integer> -    </map>  +    </map>      <key>WindowFullScreen</key>      <map>        <key>Comment</key> diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 33d006578d..b5fa198bae 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -65,31 +65,42 @@ LLDefaultChildRegistry::Register<LLBottomtrayButton> bottomtray_button("bottomtr  // virtual  BOOL LLBottomtrayButton::handleHover(S32 x, S32 y, MASK mask)  { -	S32 screenX, screenY; -	localPointToScreen(x, y, &screenX, &screenY); -	// pass hover to bottomtray -	LLBottomTray::getInstance()->onDraggableButtonHover(screenX, screenY); -	return FALSE; +	if (mCanDrag) +	{ +		S32 screenX, screenY; +		localPointToScreen(x, y, &screenX, &screenY); +		// pass hover to bottomtray +		LLBottomTray::getInstance()->onDraggableButtonHover(screenX, screenY); +		return TRUE; +	} +	else +	{ +		return LLButton::handleHover(x, y, mask); +	}  }  //virtual  BOOL LLBottomtrayButton::handleMouseUp(S32 x, S32 y, MASK mask)  { -	S32 screenX, screenY; -	localPointToScreen(x, y, &screenX, &screenY); -	// pass mouse up to bottomtray -	LLBottomTray::getInstance()->onDraggableButtonMouseUp(this, screenX, screenY); -	LLButton::handleMouseUp(x, y, mask); -	return FALSE; +	if (mCanDrag) +	{ +		S32 screenX, screenY; +		localPointToScreen(x, y, &screenX, &screenY); +		// pass mouse up to bottomtray +		LLBottomTray::getInstance()->onDraggableButtonMouseUp(this, screenX, screenY); +	} +	return LLButton::handleMouseUp(x, y, mask);  }  //virtual  BOOL LLBottomtrayButton::handleMouseDown(S32 x, S32 y, MASK mask)  { -	S32 screenX, screenY; -	localPointToScreen(x, y, &screenX, &screenY); -	// pass mouse up to bottomtray -	LLBottomTray::getInstance()->onDraggableButtonMouseDown(this, screenX, screenY); -	LLButton::handleMouseDown(x, y, mask); -	return FALSE; +	if (mCanDrag) +	{ +		S32 screenX, screenY; +		localPointToScreen(x, y, &screenX, &screenY); +		// pass mouse up to bottomtray +		LLBottomTray::getInstance()->onDraggableButtonMouseDown(this, screenX, screenY); +	} +	return LLButton::handleMouseDown(x, y, mask);  }  static void update_build_button_enable_state() @@ -150,8 +161,6 @@ public:  	{  		mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL);  		buildFromFile("panel_bottomtray_lite.xml"); -		// Necessary for focus movement among child controls -		setFocusRoot(TRUE);  	}  	BOOL postBuild() @@ -211,16 +220,11 @@ LLBottomTray::LLBottomTray(const LLSD&)  	buildFromFile("panel_bottomtray.xml"); -	LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2)); -  	//this is to fix a crash that occurs because LLBottomTray is a singleton  	//and thus is deleted at the end of the viewers lifetime, but to be cleanly  	//destroyed LLBottomTray requires some subsystems that are long gone  	//LLUI::getRootView()->addChild(this); -	// Necessary for focus movement among child controls -	setFocusRoot(TRUE); -  	{  		mBottomTrayLite = new LLBottomTrayLite();  		mBottomTrayLite->setFollowsAll(); diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 8d8a42c553..dc98170049 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -54,7 +54,9 @@ class LLBottomtrayButton : public LLButton  public:  	struct Params : public LLInitParam::Block<Params, LLButton::Params>  	{ -		Params(){} +		Optional<bool> can_drag; +		Params() +		: can_drag("can_drag", true){}  	};  	/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);  	/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -62,11 +64,14 @@ public:  protected:  	LLBottomtrayButton(const Params& p) -		:	LLButton(p) +	:	LLButton(p), +		mCanDrag(p.can_drag)  	{  	}  	friend class LLUICtrlFactory; + +	bool mCanDrag;  };  class LLBottomTray  diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index ad24c6534a..b4e211a38e 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -336,6 +336,9 @@ LLFloaterCamera::LLFloaterCamera(const LLSD& val)  	mCurrMode(CAMERA_CTRL_MODE_PAN),  	mPrevMode(CAMERA_CTRL_MODE_PAN)  { +	LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; +	registrar.add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2)); +  }  // virtual diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 58849393b4..e4f83ce6b9 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -276,9 +276,6 @@ LLNavigationBar::LLNavigationBar()  	// set a listener function for LoginComplete event  	LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLNavigationBar::handleLoginComplete, this)); - -	// Necessary for focus movement among child controls -	setFocusRoot(TRUE);  }  LLNavigationBar::~LLNavigationBar() diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 7c93d8a1f9..2f3e0875b8 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -163,8 +163,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,  	mHtmlAvailable( TRUE ),  	mListener(new LLPanelLoginListener(this))  { -	setFocusRoot(TRUE); -  	setBackgroundVisible(FALSE);  	setBackgroundOpaque(TRUE); diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 521e5005e8..53d8a5c19e 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -155,8 +155,6 @@ LLSideTrayTab::LLSideTrayTab(const Params& p)  	mDescription(p.description),  	mMainPanel(NULL)  { -	// Necessary for focus movement among child controls -	setFocusRoot(TRUE);  }  LLSideTrayTab::~LLSideTrayTab() diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index 282d4e19c6..2d8ce95347 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -33,6 +33,7 @@  #include "llview.h"  #include "llviewerwindow.h" +#include "llviewercontrol.h"  #include "lltoolcomp.h"  #include "lltoolfocus.h"  #include "llfocusmgr.h" @@ -190,9 +191,12 @@ LLTool* LLTool::getOverrideTool(MASK mask)  	{  		return NULL;  	} -	if (mask & MASK_ALT) +	if (gSavedSettings.getBOOL("EnableAltZoom"))  	{ -		return LLToolCamera::getInstance(); +		if (mask & MASK_ALT) +		{ +			return LLToolCamera::getInstance(); +		}  	}  	return NULL;  } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 864de018e0..2ee3e4ffed 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1210,15 +1210,17 @@ void LLToolPie::handleDeselect()  LLTool* LLToolPie::getOverrideTool(MASK mask)  { -	if (mask == MASK_CONTROL) +	if (gSavedSettings.getBOOL("EnableGrab"))  	{ -		return LLToolGrab::getInstance(); -	} -	else if (mask == (MASK_CONTROL | MASK_SHIFT)) -	{ -		return LLToolGrab::getInstance(); +		if (mask == MASK_CONTROL) +		{ +			return LLToolGrab::getInstance(); +		} +		else if (mask == (MASK_CONTROL | MASK_SHIFT)) +		{ +			return LLToolGrab::getInstance(); +		}  	} -  	return LLTool::getOverrideTool(mask);  } diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 63068a069f..013a8090f7 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -5,6 +5,7 @@   bg_opaque_color="DkGray"   chrome="true"   follows="left|bottom|right" + focus_root="true"    height="33"   layout="topleft"   left="0" diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml index efb1da4c05..b5e1a5f16d 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml @@ -10,6 +10,7 @@   layout="topleft"   left="0"   name="bottom_tray_lite" + focus_root="true"    tab_stop="true"   top="28"   chrome="true" diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 891616b838..321e6c4cda 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -5,6 +5,7 @@ height="600"  layout="topleft"  left="0"  name="panel_login" +focus_root="true"   top="600"   width="996">  <panel.string diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index 082d51ed3c..8a7bd53054 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -4,6 +4,7 @@   background_visible="true"   bg_opaque_color="MouseGray"   follows="left|top|right" + focus_root="true"    height="60"   layout="topleft"   name="navigation_bar" diff --git a/indra/newview/skins/default/xui/en/widgets/sidetray_tab.xml b/indra/newview/skins/default/xui/en/widgets/sidetray_tab.xml new file mode 100644 index 0000000000..aa8461d367 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/sidetray_tab.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<sidetray_tab  +  focus_root="true" +  />  | 
