summaryrefslogtreecommitdiff
path: root/indra/newview/llstatusbar.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2010-03-03 19:37:41 -0800
committerRichard Linden <none@none>2010-03-03 19:37:41 -0800
commit69f9c0bcf9764a1b682bfdd5baa3f340922dcbaa (patch)
tree0add9cfef233a0b93bb2f0d85b57cc41d8f1deb4 /indra/newview/llstatusbar.cpp
parentc3c04adaa56c895018e1d2dd32b94469aaf44347 (diff)
WIP - replace top ctrl with LLPopupView
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
-rw-r--r--indra/newview/llstatusbar.cpp33
1 files changed, 11 insertions, 22 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 732c23982b..2ed0718e41 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -239,20 +239,16 @@ BOOL LLStatusBar::postBuild()
childSetActionTextbox("stat_btn", onClickStatGraph);
- LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder");
-
mPanelVolumePulldown = new LLPanelVolumePulldown();
- popup_holder->addChild(mPanelVolumePulldown);
+ addChild(mPanelVolumePulldown);
+ mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
+ mPanelVolumePulldown->setVisible(FALSE);
mPanelNearByMedia = new LLPanelNearByMedia();
- popup_holder->addChild(mPanelNearByMedia);
- gViewerWindow->getRootView()->addMouseDownCallback(boost::bind(&LLStatusBar::onClickScreen, this, _1, _2));
+ addChild(mPanelNearByMedia);
mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
mPanelNearByMedia->setVisible(FALSE);
- mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
- mPanelVolumePulldown->setVisible(FALSE);
-
return TRUE;
}
@@ -538,8 +534,10 @@ void LLStatusBar::onMouseEnterVolume()
// show the master volume pull-down
- mPanelVolumePulldown->setVisible(TRUE);
+ LLUI::clearPopups();
+ LLUI::addPopup(mPanelVolumePulldown);
mPanelNearByMedia->setVisible(FALSE);
+ mPanelVolumePulldown->setVisible(TRUE);
}
void LLStatusBar::onMouseEnterNearbyMedia()
@@ -558,8 +556,11 @@ void LLStatusBar::onMouseEnterNearbyMedia()
// show the master volume pull-down
mPanelNearByMedia->setShape(nearby_media_rect);
- mPanelNearByMedia->setVisible(TRUE);
+ LLUI::clearPopups();
+ LLUI::addPopup(mPanelNearByMedia);
+
mPanelVolumePulldown->setVisible(FALSE);
+ mPanelNearByMedia->setVisible(TRUE);
}
@@ -648,18 +649,6 @@ void LLStatusBar::onClickStatGraph(void* data)
LLFloaterReg::showInstance("lagmeter");
}
-void LLStatusBar::onClickScreen(S32 x, S32 y)
-{
- if (mPanelNearByMedia->getVisible())
- {
- LLRect screen_rect = mPanelNearByMedia->calcScreenRect();
- if (!screen_rect.pointInRect(x, y))
- {
- mPanelNearByMedia->setVisible(FALSE);
- }
- }
-}
-
BOOL can_afford_transaction(S32 cost)
{
return((cost <= 0)||((gStatusBar) && (gStatusBar->getBalance() >=cost)));