diff options
author | Richard Linden <none@none> | 2010-02-12 16:54:47 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2010-02-12 16:54:47 -0800 |
commit | e159873eec4137b041fc8045f6d79ac6c21d2101 (patch) | |
tree | d7771ea0f704933037cb2669f464a2ae61a755f6 /indra/newview | |
parent | 9f3c3d8f64be7c7321f6037dcd78234417c0a2d8 (diff) |
added popup panel to hold nearby media popup and stopped using top view
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelnearbymedia.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llrootview.h | 1 | ||||
-rw-r--r-- | indra/newview/llstatusbar.cpp | 47 | ||||
-rw-r--r-- | indra/newview/llstatusbar.h | 1 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/main_view.xml | 6 |
6 files changed, 57 insertions, 22 deletions
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 3480abcf40..9753fd9b54 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -184,22 +184,26 @@ void LLPanelNearByMedia::handleVisibilityChange ( BOOL new_visibility ) if (new_visibility) { mHoverTimer.start(); // timer will be stopped when mouse hovers over panel - gFocusMgr.setTopCtrl(this); + //gFocusMgr.setTopCtrl(this); } else { mHoverTimer.stop(); - if (gFocusMgr.getTopCtrl() == this) - { - gFocusMgr.setTopCtrl(NULL); - } + //if (gFocusMgr.getTopCtrl() == this) + //{ + // gFocusMgr.setTopCtrl(NULL); + //} } } /*virtual*/ void LLPanelNearByMedia::onTopLost () { - setVisible(FALSE); + //LLUICtrl* new_top = gFocusMgr.getTopCtrl(); + //if (!new_top || !new_top->hasAncestor(this)) + //{ + // setVisible(FALSE); + //} } /*virtual*/ @@ -220,6 +224,13 @@ const F32 AUTO_CLOSE_FADE_TIME_END = 5.0f; void LLPanelNearByMedia::draw() { + //LLUICtrl* new_top = gFocusMgr.getTopCtrl(); + //if (new_top != this) + //{ + // // reassert top ctrl + // gFocusMgr.setTopCtrl(this); + //} + // keep bottom of panel on screen LLRect screen_rect = calcScreenRect(); if (screen_rect.mBottom < 0) diff --git a/indra/newview/llrootview.h b/indra/newview/llrootview.h index 760b1a7a4c..38029e3a9d 100644 --- a/indra/newview/llrootview.h +++ b/indra/newview/llrootview.h @@ -35,6 +35,7 @@ #include "llview.h" #include "lluictrlfactory.h" +#include "lltooltip.h" class LLRootViewRegistry : public LLChildRegistry<LLRootViewRegistry> {}; diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 025f03dc5a..5423b3e99f 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -50,6 +50,7 @@ #include "llkeyboard.h" #include "lllineeditor.h" #include "llmenugl.h" +#include "llrootview.h" #include "llsd.h" #include "lltextbox.h" #include "llui.h" @@ -242,7 +243,11 @@ BOOL LLStatusBar::postBuild() addChild(mPanelVolumePulldown); mPanelNearByMedia = new LLPanelNearByMedia(); - addChild(mPanelNearByMedia); + LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); + popup_holder->addChild(mPanelNearByMedia); + gViewerWindow->getRootView()->addMouseDownCallback(boost::bind(&LLStatusBar::onClickScreen, this, _1, _2)); + mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); + mPanelNearByMedia->setVisible(FALSE); LLRect volume_pulldown_rect = mPanelVolumePulldown->getRect(); LLButton* volbtn = getChild<LLButton>( "volume_btn" ); @@ -256,21 +261,6 @@ 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; } @@ -542,7 +532,20 @@ void LLStatusBar::onMouseEnterVolume() void LLStatusBar::onMouseEnterNearbyMedia() { + LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); + LLRect nearby_media_rect = mPanelNearByMedia->getRect(); + LLButton* nearby_media_btn = getChild<LLButton>( "media_toggle_btn" ); + LLRect nearby_media_btn_rect = nearby_media_btn->calcScreenRect(); + nearby_media_rect.setLeftTopAndSize(nearby_media_btn_rect.mLeft - + (nearby_media_rect.getWidth() - nearby_media_btn_rect.getWidth())/2, + nearby_media_btn_rect.mBottom, + nearby_media_rect.getWidth(), + nearby_media_rect.getHeight()); + // force onscreen + nearby_media_rect.translate(popup_holder->getRect().getWidth() - nearby_media_rect.mRight, 0); + // show the master volume pull-down + mPanelNearByMedia->setShape(nearby_media_rect); mPanelNearByMedia->setVisible(TRUE); } @@ -631,6 +634,18 @@ 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))); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index c37c27299f..e5240fcc3e 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -99,6 +99,7 @@ private: void onMouseEnterVolume(); void onMouseEnterNearbyMedia(); + void onClickScreen(S32 x, S32 y); static void onClickStatGraph(void* data); static void onClickMediaToggle(void* data); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b76a2e150f..f258be0397 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -982,6 +982,7 @@ void LLViewerWindow::handleMouseLeave(LLWindow *window) // Note: we won't get this if we have captured the mouse. llassert( gFocusMgr.getMouseCapture() == NULL ); mMouseInWindow = FALSE; + LLToolTipMgr::instance().blockToolTips(); } BOOL LLViewerWindow::handleCloseRequest(LLWindow *window) diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index 1d4377e339..7b6081d7be 100644 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -162,6 +162,12 @@ mouse_opaque="false" name="Menu Holder" width="1024"/> + <panel top="0" + follows="all" + height="768" + mouse_opaque="false" + name="popup_holder" + width="1024"/> <snapshot_floater_view enabled="false" follows="all" height="768" |