summaryrefslogtreecommitdiff
path: root/indra/newview/llstatusbar.cpp
diff options
context:
space:
mode:
authorrichard <none@none>2010-02-11 18:11:08 -0800
committerrichard <none@none>2010-02-11 18:11:08 -0800
commit48a66364a11b2f4211b1a5b66e20e9e3335c0208 (patch)
tree41ec68ffc0f97f58bb79bd9733430418d5222b5f /indra/newview/llstatusbar.cpp
parentcd73d688463553158dab03c31b23e17a814072fa (diff)
parent6c5b984bf670e34fd88a8f1a0bdeb1042fa531b2 (diff)
merge
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
-rw-r--r--indra/newview/llstatusbar.cpp33
1 files changed, 29 insertions, 4 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 48de23fab1..025f03dc5a 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -41,6 +41,7 @@
#include "llviewercontrol.h"
#include "llfloaterbuycurrency.h"
#include "llfloaterlagmeter.h"
+#include "llpanelnearbymedia.h"
#include "llpanelvolumepulldown.h"
#include "llfloaterregioninfo.h"
#include "llfloaterscriptdebug.h"
@@ -191,7 +192,7 @@ BOOL LLStatusBar::postBuild()
mMediaToggle = getChild<LLButton>("media_toggle_btn");
mMediaToggle->setClickedCallback( &LLStatusBar::onClickMediaToggle, this );
- mMediaToggle->setMouseEnterCallback(boost::bind(&LLFloaterReg::showInstance, "nearby_media", LLSD(), true));
+ mMediaToggle->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterNearbyMedia, this));
gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2));
@@ -240,6 +241,9 @@ BOOL LLStatusBar::postBuild()
mPanelVolumePulldown = new LLPanelVolumePulldown();
addChild(mPanelVolumePulldown);
+ mPanelNearByMedia = new LLPanelNearByMedia();
+ addChild(mPanelNearByMedia);
+
LLRect volume_pulldown_rect = mPanelVolumePulldown->getRect();
LLButton* volbtn = getChild<LLButton>( "volume_btn" );
volume_pulldown_rect.setLeftTopAndSize(volbtn->getRect().mLeft -
@@ -252,6 +256,21 @@ BOOL LLStatusBar::postBuild()
mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
mPanelVolumePulldown->setVisible(FALSE);
+ LLRect nearby_media_rect = mPanelNearByMedia->getRect();
+ LLButton* nearby_media_btn = getChild<LLButton>( "media_toggle_btn" );
+ nearby_media_rect.setLeftTopAndSize(nearby_media_btn->getRect().mLeft -
+ (volume_pulldown_rect.getWidth() - nearby_media_btn->getRect().getWidth())/2,
+ nearby_media_btn->calcScreenRect().mBottom,
+ nearby_media_rect.getWidth(),
+ nearby_media_rect.getHeight());
+ // force onscreen
+ nearby_media_rect.translate(getRect().getWidth() - nearby_media_rect.mRight, 0);
+
+ mPanelNearByMedia->setShape(nearby_media_rect);
+ mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
+ mPanelNearByMedia->setVisible(FALSE);
+
+
return TRUE;
}
@@ -515,13 +534,19 @@ static void onClickScriptDebug(void*)
LLFloaterScriptDebug::show(LLUUID::null);
}
-//static
-void LLStatusBar::onMouseEnterVolume(LLUICtrl* ctrl)
+void LLStatusBar::onMouseEnterVolume()
+{
+ // show the master volume pull-down
+ mPanelVolumePulldown->setVisible(TRUE);
+}
+
+void LLStatusBar::onMouseEnterNearbyMedia()
{
// show the master volume pull-down
- gStatusBar->mPanelVolumePulldown->setVisible(TRUE);
+ mPanelNearByMedia->setVisible(TRUE);
}
+
static void onClickVolume(void* data)
{
// toggle the master mute setting