summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Linden <none@none>2010-02-12 16:54:47 -0800
committerRichard Linden <none@none>2010-02-12 16:54:47 -0800
commite159873eec4137b041fc8045f6d79ac6c21d2101 (patch)
treed7771ea0f704933037cb2669f464a2ae61a755f6
parent9f3c3d8f64be7c7321f6037dcd78234417c0a2d8 (diff)
added popup panel to hold nearby media popup and stopped using top view
-rw-r--r--indra/llui/lltooltip.cpp6
-rw-r--r--indra/llui/lltooltip.h2
-rw-r--r--indra/newview/llpanelnearbymedia.cpp23
-rw-r--r--indra/newview/llrootview.h1
-rw-r--r--indra/newview/llstatusbar.cpp47
-rw-r--r--indra/newview/llstatusbar.h1
-rw-r--r--indra/newview/llviewerwindow.cpp1
-rw-r--r--indra/newview/skins/default/xui/en/main_view.xml6
8 files changed, 57 insertions, 30 deletions
diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp
index 173fde8e76..ed7fd02e14 100644
--- a/indra/llui/lltooltip.cpp
+++ b/indra/llui/lltooltip.cpp
@@ -129,12 +129,6 @@ BOOL LLToolTipView::handleScrollWheel( S32 x, S32 y, S32 clicks )
return FALSE;
}
-void LLToolTipView::onMouseLeave(S32 x, S32 y, MASK mask)
-{
- LLToolTipMgr::instance().blockToolTips();
-}
-
-
void LLToolTipView::drawStickyRect()
{
gl_rect_2d(LLToolTipMgr::instance().getMouseNearRect(), LLColor4::white, false);
diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h
index c0811c56c3..24e32b9b24 100644
--- a/indra/llui/lltooltip.h
+++ b/indra/llui/lltooltip.h
@@ -56,8 +56,6 @@ public:
/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleScrollWheel( S32 x, S32 y, S32 clicks );
- /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
-
void drawStickyRect();
/*virtual*/ void draw();
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"