diff options
| author | Rick Pasetto <rick@lindenlab.com> | 2009-12-16 15:03:21 -0800 | 
|---|---|---|
| committer | Rick Pasetto <rick@lindenlab.com> | 2009-12-16 15:03:21 -0800 | 
| commit | e1b712a3a63e9103992b7a999a2bc94111f0401f (patch) | |
| tree | 1e80e0c20e6e8827143d9e16338bd2abb61f8503 /indra | |
| parent | a9948da80ade03523eaab1c46340313b57ee7eb6 (diff) | |
DEV-42827: auto-hide media controls volume slider if neither it nor mute button has the mouse over it
Review #66
fade-out was going to be harder, but just making it visible/invisible turned out to be pretty easy
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llpanelprimmediacontrols.cpp | 17 | ||||
| -rw-r--r-- | indra/newview/llpanelprimmediacontrols.h | 3 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_prim_media_controls.xml | 6 | 
3 files changed, 20 insertions, 6 deletions
| diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 7b2ac38568..5cc9c1951b 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -96,7 +96,7 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() :  	mTargetObjectNormal(LLVector3::zero),  	mZoomObjectID(LLUUID::null),  	mZoomObjectFace(0), -	mVolumeSliderVisible(false) +	mVolumeSliderVisible(0)  {  	mCommitCallbackRegistrar.add("MediaCtrl.Close",		boost::bind(&LLPanelPrimMediaControls::onClickClose, this));  	mCommitCallbackRegistrar.add("MediaCtrl.Back",		boost::bind(&LLPanelPrimMediaControls::onClickBack, this)); @@ -116,6 +116,7 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() :  	mCommitCallbackRegistrar.add("MediaCtrl.Volume",	boost::bind(&LLPanelPrimMediaControls::onCommitVolumeSlider, this));  	mCommitCallbackRegistrar.add("MediaCtrl.ToggleMute",		boost::bind(&LLPanelPrimMediaControls::onToggleMute, this));  	mCommitCallbackRegistrar.add("MediaCtrl.ShowVolumeSlider",		boost::bind(&LLPanelPrimMediaControls::showVolumeSlider, this)); +	mCommitCallbackRegistrar.add("MediaCtrl.HideVolumeSlider",		boost::bind(&LLPanelPrimMediaControls::hideVolumeSlider, this));  	mCommitCallbackRegistrar.add("MediaCtrl.SkipBack",		boost::bind(&LLPanelPrimMediaControls::onClickSkipBack, this));  	mCommitCallbackRegistrar.add("MediaCtrl.SkipForward",	boost::bind(&LLPanelPrimMediaControls::onClickSkipForward, this)); @@ -372,8 +373,8 @@ void LLPanelPrimMediaControls::updateShape()  			mVolumeUpCtrl->setVisible(has_focus);  			mVolumeDownCtrl->setVisible(has_focus);  			mVolumeCtrl->setEnabled(has_focus); -			mVolumeSliderCtrl->setEnabled(has_focus && mVolumeSliderVisible); -			mVolumeSliderCtrl->setVisible(has_focus && mVolumeSliderVisible); +			mVolumeSliderCtrl->setEnabled(has_focus && mVolumeSliderVisible > 0); +			mVolumeSliderCtrl->setVisible(has_focus && mVolumeSliderVisible > 0);  			mWhitelistIcon->setVisible(false);  			mSecureLockIcon->setVisible(false); @@ -714,7 +715,7 @@ void LLPanelPrimMediaControls::draw()  				setVisible(FALSE);  				mClearFaceOnFade = false; -				mVolumeSliderVisible = false; +				mVolumeSliderVisible = 0;  				mTargetImplID = LLUUID::null;  				mTargetObjectID = LLUUID::null;  				mTargetObjectFace = 0; @@ -1267,5 +1268,11 @@ void LLPanelPrimMediaControls::onToggleMute()  void LLPanelPrimMediaControls::showVolumeSlider()  { -	mVolumeSliderVisible = true; +	mVolumeSliderVisible++; +} + + +void LLPanelPrimMediaControls::hideVolumeSlider() +{ +	mVolumeSliderVisible--;  } diff --git a/indra/newview/llpanelprimmediacontrols.h b/indra/newview/llpanelprimmediacontrols.h index 17e65b8b0c..d899ee4473 100644 --- a/indra/newview/llpanelprimmediacontrols.h +++ b/indra/newview/llpanelprimmediacontrols.h @@ -110,6 +110,7 @@ private:  	void onCommitVolumeSlider();  	void onToggleMute();  	void showVolumeSlider(); +	void hideVolumeSlider();  	static void onScrollUp(void* user_data);  	static void onScrollUpHeld(void* user_data); @@ -204,7 +205,7 @@ private:  	LLUUID mZoomObjectID;  	S32 mZoomObjectFace; -	bool mVolumeSliderVisible; +	S32 mVolumeSliderVisible;  };  #endif // LL_PANELPRIMMEDIACONTROLS_H diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml index 3fdfc5f672..b14089c3a2 100644 --- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml +++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml @@ -399,6 +399,8 @@  			function="MediaCtrl.ToggleMute" />  		<button.mouseenter_callback  			function="MediaCtrl.ShowVolumeSlider" /> +		<button.mouseleave_callback +			function="MediaCtrl.HideVolumeSlider" />  	  </button>  	  <slider  		  orientation="vertical" @@ -414,6 +416,10 @@  		  volume="true">  		<slider.commit_callback  			function="MediaCtrl.Volume"/> +		<slider.mouseenter_callback +			function="MediaCtrl.ShowVolumeSlider" /> +		<slider.mouseleave_callback +			function="MediaCtrl.HideVolumeSlider" />  	  </slider>  	</layout_panel>  	<panel | 
