diff options
author | richard <none@none> | 2010-02-11 18:06:25 -0800 |
---|---|---|
committer | richard <none@none> | 2010-02-11 18:06:25 -0800 |
commit | 6c5b984bf670e34fd88a8f1a0bdeb1042fa531b2 (patch) | |
tree | 32865ad0feb6311d06b3c12a738fb60bcf8c1ac5 /indra/newview/llstatusbar.cpp | |
parent | 62e1508bf603a58afdd5e2cc8ca40927a791ba47 (diff) |
converted llfloaternearbymedia to llpanelnearbymedia
moved from LLTransientDockableFloater model to popup panel model like volume popup
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
-rw-r--r-- | indra/newview/llstatusbar.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index a2648e4c3a..64cb739bea 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" @@ -189,7 +190,7 @@ BOOL LLStatusBar::postBuild() mBtnVolume->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterVolume, this)); LLButton* media_toggle = getChild<LLButton>("media_toggle_btn"); - media_toggle->setMouseEnterCallback(boost::bind(&LLFloaterReg::showInstance, "nearby_media", LLSD(), true)); + media_toggle->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterNearbyMedia, this)); gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&LLStatusBar::onVolumeChanged, this, _2)); @@ -238,6 +239,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 - @@ -250,6 +254,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; } @@ -511,13 +530,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 |