summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelprimmediacontrols.cpp
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2009-12-16 15:03:21 -0800
committerRick Pasetto <rick@lindenlab.com>2009-12-16 15:03:21 -0800
commite1b712a3a63e9103992b7a999a2bc94111f0401f (patch)
tree1e80e0c20e6e8827143d9e16338bd2abb61f8503 /indra/newview/llpanelprimmediacontrols.cpp
parenta9948da80ade03523eaab1c46340313b57ee7eb6 (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/newview/llpanelprimmediacontrols.cpp')
-rw-r--r--indra/newview/llpanelprimmediacontrols.cpp17
1 files changed, 12 insertions, 5 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--;
}