diff options
author | Jonathan Yap <jhwelch@gmail.com> | 2014-11-28 10:00:41 -0500 |
---|---|---|
committer | Jonathan Yap <jhwelch@gmail.com> | 2014-11-28 10:00:41 -0500 |
commit | af827615acc6cce0457ba00810136c41283f6158 (patch) | |
tree | 8edd97ee239f407151e8b8b8d9d44c64915f68fb /indra/newview/llstatusbar.cpp | |
parent | f30e518f1774cc3c1b4641e97c26afa496fb85e5 (diff) |
STORM-2082 Initial support for presets popup from status bar
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
-rwxr-xr-x | indra/newview/llstatusbar.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index eedb829b48..3c8dcaf4d4 100755 --- 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" @@ -175,6 +176,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)); @@ -228,6 +232,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); @@ -465,6 +474,27 @@ void LLStatusBar::onClickBuyCurrency() LLFirstUse::receiveLindens(false); } +void LLStatusBar::onMouseEnterPresets() +{ + LLIconCtrl* icon = getChild<LLIconCtrl>( "presets_icon" ); + LLRect btn_rect = icon->getRect(); + LLRect pulldown_rect = mPanelPresetsPulldown->getRect(); + pulldown_rect.setLeftTopAndSize(btn_rect.mLeft - + (pulldown_rect.getWidth() - btn_rect.getWidth()), + btn_rect.mBottom, + pulldown_rect.getWidth(), + pulldown_rect.getHeight()); + + 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() { LLButton* volbtn = getChild<LLButton>( "volume_btn" ); @@ -482,6 +512,7 @@ void LLStatusBar::onMouseEnterVolume() // show the master volume pull-down LLUI::clearPopups(); LLUI::addPopup(mPanelVolumePulldown); + mPanelPresetsPulldown->setVisible(FALSE); mPanelNearByMedia->setVisible(FALSE); mPanelVolumePulldown->setVisible(TRUE); } @@ -505,6 +536,7 @@ void LLStatusBar::onMouseEnterNearbyMedia() LLUI::clearPopups(); LLUI::addPopup(mPanelNearByMedia); + mPanelPresetsPulldown->setVisible(FALSE); mPanelVolumePulldown->setVisible(FALSE); mPanelNearByMedia->setVisible(TRUE); } |