diff options
author | callum_linden <none@none> | 2016-05-19 11:00:03 -0700 |
---|---|---|
committer | callum_linden <none@none> | 2016-05-19 11:00:03 -0700 |
commit | 9c4ed8d1138de86041b740139c4deec1bc6bf8ee (patch) | |
tree | d7452bc7faeae01964f13faaa16e2812b27ba93c /indra/newview/llstatusbar.cpp | |
parent | e6fb7564b02ba73c8a402efaca65cb944ce7bef2 (diff) | |
parent | c2ef3b4c7186dbbd95b16520f281b7d58364fb52 (diff) |
Automated merge with tip of viewer-release to pick up 4.0.5
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
-rw-r--r--[-rwxr-xr-x] | indra/newview/llstatusbar.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index c839ed48b5..041eae4b3c 100755..100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -38,6 +38,7 @@ #include "llfloaterbuycurrency.h" #include "llbuycurrencyhtml.h" #include "llpanelnearbymedia.h" +#include "llpanelpresetspulldown.h" #include "llpanelvolumepulldown.h" #include "llfloaterregioninfo.h" #include "llfloaterscriptdebug.h" @@ -170,6 +171,9 @@ BOOL LLStatusBar::postBuild() mBtnStats = getChildView("stat_btn"); + mIconPresets = getChild<LLIconCtrl>( "presets_icon" ); + mIconPresets->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterPresets, this)); + mBtnVolume = getChild<LLButton>( "volume_btn" ); mBtnVolume->setClickedCallback( onClickVolume, this ); mBtnVolume->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterVolume, this)); @@ -223,6 +227,11 @@ BOOL LLStatusBar::postBuild() mSGPacketLoss = LLUICtrlFactory::create<LLStatGraph>(pgp); addChild(mSGPacketLoss); + mPanelPresetsPulldown = new LLPanelPresetsPulldown(); + addChild(mPanelPresetsPulldown); + mPanelPresetsPulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); + mPanelPresetsPulldown->setVisible(FALSE); + mPanelVolumePulldown = new LLPanelVolumePulldown(); addChild(mPanelVolumePulldown); mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); @@ -316,6 +325,7 @@ void LLStatusBar::setVisibleForMouselook(bool visible) mSGBandwidth->setVisible(visible); mSGPacketLoss->setVisible(visible); setBackgroundVisible(visible); + mIconPresets->setVisible(visible); } void LLStatusBar::debitBalance(S32 debit) @@ -460,8 +470,32 @@ void LLStatusBar::onClickBuyCurrency() LLFirstUse::receiveLindens(false); } +void LLStatusBar::onMouseEnterPresets() +{ + LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); + LLIconCtrl* icon = getChild<LLIconCtrl>( "presets_icon" ); + LLRect icon_rect = icon->getRect(); + LLRect pulldown_rect = mPanelPresetsPulldown->getRect(); + pulldown_rect.setLeftTopAndSize(icon_rect.mLeft - + (pulldown_rect.getWidth() - icon_rect.getWidth()), + icon_rect.mBottom, + pulldown_rect.getWidth(), + pulldown_rect.getHeight()); + + pulldown_rect.translate(popup_holder->getRect().getWidth() - pulldown_rect.mRight, 0); + mPanelPresetsPulldown->setShape(pulldown_rect); + + // show the master presets pull-down + LLUI::clearPopups(); + LLUI::addPopup(mPanelPresetsPulldown); + mPanelNearByMedia->setVisible(FALSE); + mPanelVolumePulldown->setVisible(FALSE); + mPanelPresetsPulldown->setVisible(TRUE); +} + void LLStatusBar::onMouseEnterVolume() { + LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); LLButton* volbtn = getChild<LLButton>( "volume_btn" ); LLRect vol_btn_rect = volbtn->getRect(); LLRect volume_pulldown_rect = mPanelVolumePulldown->getRect(); @@ -471,12 +505,14 @@ void LLStatusBar::onMouseEnterVolume() volume_pulldown_rect.getWidth(), volume_pulldown_rect.getHeight()); + volume_pulldown_rect.translate(popup_holder->getRect().getWidth() - volume_pulldown_rect.mRight, 0); mPanelVolumePulldown->setShape(volume_pulldown_rect); // show the master volume pull-down LLUI::clearPopups(); LLUI::addPopup(mPanelVolumePulldown); + mPanelPresetsPulldown->setVisible(FALSE); mPanelNearByMedia->setVisible(FALSE); mPanelVolumePulldown->setVisible(TRUE); } @@ -500,6 +536,7 @@ void LLStatusBar::onMouseEnterNearbyMedia() LLUI::clearPopups(); LLUI::addPopup(mPanelNearByMedia); + mPanelPresetsPulldown->setVisible(FALSE); mPanelVolumePulldown->setVisible(FALSE); mPanelNearByMedia->setVisible(TRUE); } |