summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRichard Nelson <none@none>2010-03-02 14:21:58 -0800
committerRichard Nelson <none@none>2010-03-02 14:21:58 -0800
commit41a30a59fb1b6dea2d531333d0429632f1fef2fe (patch)
tree3ffb4b300541511aeb94f83b491384cb29f5f584 /indra/newview
parenta16574b919b71a67f84ac075ed2c2b717d112d31 (diff)
initial work changing topctrl to popup layer
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/CMakeLists.txt2
-rw-r--r--indra/newview/llappviewer.cpp6
-rw-r--r--indra/newview/llexpandabletextbox.cpp15
-rw-r--r--indra/newview/llexpandabletextbox.h5
-rw-r--r--indra/newview/llfolderview.cpp13
-rw-r--r--indra/newview/llpanelnearbymedia.cpp22
-rw-r--r--indra/newview/llpanelnearbymedia.h1
-rw-r--r--indra/newview/llprogressview.cpp5
-rw-r--r--indra/newview/llsplitbutton.cpp7
-rw-r--r--indra/newview/lluploaddialog.cpp2
-rw-r--r--indra/newview/llviewerwindow.cpp77
-rw-r--r--indra/newview/llviewerwindow.h9
-rw-r--r--indra/newview/skins/default/xui/en/main_view.xml13
13 files changed, 88 insertions, 89 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 14eb75e457..8ad3b2085d 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -347,6 +347,7 @@ set(viewer_SOURCE_FILES
llpatchvertexarray.cpp
llplacesinventorybridge.cpp
llplacesinventorypanel.cpp
+ llpopupview.cpp
llpolymesh.cpp
llpolymorph.cpp
llpreview.cpp
@@ -844,6 +845,7 @@ set(viewer_HEADER_FILES
llplacesinventorypanel.h
llpolymesh.h
llpolymorph.h
+ llpopupview.h
llpreview.h
llpreviewanim.h
llpreviewgesture.h
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 948d38befb..a06e54e208 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -702,9 +702,9 @@ bool LLAppViewer::init()
settings_map["account"] = &gSavedPerAccountSettings;
LLUI::initClass(settings_map,
- LLUIImageList::getInstance(),
- ui_audio_callback,
- &LLUI::sGLScaleFactor);
+ LLUIImageList::getInstance(),
+ ui_audio_callback,
+ &LLUI::sGLScaleFactor);
// Setup paths and LLTrans after LLUI::initClass has been called
LLUI::setupPaths();
diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp
index 3818ee6f78..9a906d8323 100644
--- a/indra/newview/llexpandabletextbox.cpp
+++ b/indra/newview/llexpandabletextbox.cpp
@@ -35,6 +35,7 @@
#include "llscrollcontainer.h"
#include "llwindow.h"
+#include "llviewerwindow.h"
static LLDefaultChildRegistry::Register<LLExpandableTextBox> t1("expandable_text");
@@ -382,7 +383,7 @@ void LLExpandableTextBox::expandTextBox()
setFocus(TRUE);
// this lets us receive top_lost event(needed to collapse text box)
// it also draws text box above all other ui elements
- gFocusMgr.setTopCtrl(this);
+ gViewerWindow->addPopup(this);
mExpanded = true;
}
@@ -401,10 +402,7 @@ void LLExpandableTextBox::collapseTextBox()
updateTextBoxRect();
- if(gFocusMgr.getTopCtrl() == this)
- {
- gFocusMgr.setTopCtrl(NULL);
- }
+ gViewerWindow->removePopup(this);
}
void LLExpandableTextBox::onFocusLost()
@@ -414,13 +412,6 @@ void LLExpandableTextBox::onFocusLost()
LLUICtrl::onFocusLost();
}
-void LLExpandableTextBox::onTopLost()
-{
- collapseTextBox();
-
- LLUICtrl::onTopLost();
-}
-
void LLExpandableTextBox::setValue(const LLSD& value)
{
collapseTextBox();
diff --git a/indra/newview/llexpandabletextbox.h b/indra/newview/llexpandabletextbox.h
index 58316ddb98..690c500e84 100644
--- a/indra/newview/llexpandabletextbox.h
+++ b/indra/newview/llexpandabletextbox.h
@@ -140,11 +140,6 @@ public:
/*virtual*/ void onFocusLost();
/**
- * Collapses text box on top_lost event
- */
- /*virtual*/ void onTopLost();
-
- /**
* Draws text box, collapses text box if its expanded and its parent's position changed
*/
/*virtual*/ void draw();
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 23f19a38a6..ff19a974bb 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -284,10 +284,7 @@ LLFolderView::~LLFolderView( void )
LLView::deleteViewByHandle(mPopupMenuHandle);
- if(mRenamer == gFocusMgr.getTopCtrl())
- {
- gFocusMgr.setTopCtrl(NULL);
- }
+ gViewerWindow->removePopup(mRenamer);
mAutoOpenItems.removeAllNodes();
clearSelection();
@@ -971,7 +968,7 @@ void LLFolderView::finishRenamingItem( void )
mRenameItem->rename( mRenamer->getText() );
}
- gFocusMgr.setTopCtrl( NULL );
+ gViewerWindow->removePopup(mRenamer);
if( mRenameItem )
{
@@ -988,7 +985,7 @@ void LLFolderView::closeRenamer( void )
// will commit current name (which could be same as original name)
mRenamer->setFocus( FALSE );
mRenamer->setVisible( FALSE );
- gFocusMgr.setTopCtrl( NULL );
+ gViewerWindow->removePopup(mRenamer);
if( mRenameItem )
{
@@ -1420,7 +1417,7 @@ void LLFolderView::startRenamingSelectedItem( void )
mRenamer->setFocus( TRUE );
mRenamer->setTopLostCallback(boost::bind(onRenamerLost, _1));
mRenamer->setFocusLostCallback(boost::bind(onRenamerLost, _1));
- gFocusMgr.setTopCtrl( mRenamer );
+ gViewerWindow->addPopup(mRenamer);
}
}
@@ -1901,7 +1898,7 @@ void LLFolderView::deleteAllChildren()
{
if(mRenamer == gFocusMgr.getTopCtrl())
{
- gFocusMgr.setTopCtrl(NULL);
+ gViewerWindow->removePopup(mRenamer);
}
LLView::deleteViewByHandle(mPopupMenuHandle);
mPopupMenuHandle = LLHandle<LLView>();
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index c02f154dc8..41e37a9b1b 100644
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -193,28 +193,13 @@ void LLPanelNearByMedia::handleVisibilityChange ( BOOL new_visibility )
if (new_visibility)
{
mHoverTimer.start(); // timer will be stopped when mouse hovers over panel
- //gFocusMgr.setTopCtrl(this);
}
else
{
mHoverTimer.stop();
- //if (gFocusMgr.getTopCtrl() == this)
- //{
- // gFocusMgr.setTopCtrl(NULL);
- //}
}
}
-/*virtual*/
-void LLPanelNearByMedia::onTopLost ()
-{
- //LLUICtrl* new_top = gFocusMgr.getTopCtrl();
- //if (!new_top || !new_top->hasAncestor(this))
- //{
- // setVisible(FALSE);
- //}
-}
-
/*virtual*/
void LLPanelNearByMedia::reshape(S32 width, S32 height, BOOL called_from_parent)
{
@@ -234,13 +219,6 @@ const F32 AUTO_CLOSE_FADE_TIME_END = 5.0f;
/*virtual*/
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/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h
index 4f864519f5..809a8d81a1 100644
--- a/indra/newview/llpanelnearbymedia.h
+++ b/indra/newview/llpanelnearbymedia.h
@@ -54,7 +54,6 @@ public:
/*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
/*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
/*virtual*/ void handleVisibilityChange ( BOOL new_visibility );
- /*virtual*/ void onTopLost ();
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent);
/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp
index 0476e785a5..15831d85a0 100644
--- a/indra/newview/llprogressview.cpp
+++ b/indra/newview/llprogressview.cpp
@@ -128,11 +128,14 @@ void LLProgressView::setVisible(BOOL visible)
{
if (getVisible() && !visible)
{
+ gViewerWindow->removePopup(this);
+
mFadeTimer.start();
}
else if (!getVisible() && visible)
{
- gFocusMgr.setTopCtrl(this);
+ gViewerWindow->addPopup(this);
+
setFocus(TRUE);
mFadeTimer.stop();
mProgressTimer.start();
diff --git a/indra/newview/llsplitbutton.cpp b/indra/newview/llsplitbutton.cpp
index ffd9bc7624..e5323db466 100644
--- a/indra/newview/llsplitbutton.cpp
+++ b/indra/newview/llsplitbutton.cpp
@@ -165,7 +165,7 @@ void LLSplitButton::showButtons()
// register ourselves as a "top" control
// effectively putting us into a special draw layer
- gFocusMgr.setTopCtrl(this);
+ gViewerWindow->addPopup(this);
mItemsPanel->setFocus(TRUE);
@@ -182,10 +182,7 @@ void LLSplitButton::hideButtons()
mArrowBtn->setToggleState(FALSE);
setUseBoundingRect(FALSE);
- if(gFocusMgr.getTopCtrl() == this)
- {
- gFocusMgr.setTopCtrl(NULL);
- }
+ gViewerWindow->removePopup(this);
}
diff --git a/indra/newview/lluploaddialog.cpp b/indra/newview/lluploaddialog.cpp
index 577b5952e5..22c7d670f8 100644
--- a/indra/newview/lluploaddialog.cpp
+++ b/indra/newview/lluploaddialog.cpp
@@ -91,7 +91,7 @@ LLUploadDialog::LLUploadDialog( const std::string& msg)
setMessage(msg);
// The dialog view is a root view
- gFocusMgr.setTopCtrl( this );
+ gViewerWindow->addPopup(this);
}
void LLUploadDialog::setMessage( const std::string& msg)
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index f1ec489a20..5bd79c67c3 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -131,6 +131,7 @@
#include "llmorphview.h"
#include "llmoveview.h"
#include "llnavigationbar.h"
+#include "llpopupview.h"
#include "llpreviewtexture.h"
#include "llprogressview.h"
#include "llresmgr.h"
@@ -690,30 +691,30 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK
}
// Topmost view gets a chance before the hierarchy
- LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
- if (top_ctrl)
- {
- S32 local_x, local_y;
- top_ctrl->screenPointToLocal( x, y, &local_x, &local_y );
- if (down)
- {
- if (top_ctrl->pointInView(local_x, local_y))
- {
- return top_ctrl->handleAnyMouseClick(local_x, local_y, mask, clicktype, down) ;
- }
- else
- {
- gFocusMgr.setTopCtrl(NULL);
- }
- }
- else
- {
- if (top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask))
- {
- return TRUE;
- }
- }
- }
+ //LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
+ //if (top_ctrl)
+ //{
+ // S32 local_x, local_y;
+ // top_ctrl->screenPointToLocal( x, y, &local_x, &local_y );
+ // if (down)
+ // {
+ // if (top_ctrl->pointInView(local_x, local_y))
+ // {
+ // return top_ctrl->handleAnyMouseClick(local_x, local_y, mask, clicktype, down) ;
+ // }
+ // else
+ // {
+ // gFocusMgr.setTopCtrl(NULL);
+ // }
+ // }
+ // else
+ // {
+ // if (top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask))
+ // {
+ // return TRUE;
+ // }
+ // }
+ //}
// Give the UI views a chance to process the click
if( mRootView->handleAnyMouseClick(x, y, mask, clicktype, down) )
@@ -1367,6 +1368,8 @@ LLViewerWindow::LLViewerWindow(
LLNotifications::instance().setIgnoreAllNotifications(gSavedSettings.getBOOL("IgnoreAllNotifications"));
llinfos << "NOTE: ALL NOTIFICATIONS THAT OCCUR WILL GET ADDED TO IGNORE LIST FOR LATER RUNS." << llendl;
+ LLUI::setPopupFuncs(boost::bind(&LLViewerWindow::addPopup, this, _1), boost::bind(&LLViewerWindow::removePopup, this, _1), boost::bind(&LLViewerWindow::clearPopups, this));
+
// Default to application directory.
LLViewerWindow::sSnapshotBaseName = "Snapshot";
LLViewerWindow::sMovieBaseName = "SLmovie";
@@ -1559,11 +1562,13 @@ void LLViewerWindow::initBase()
mWorldViewPlaceholder = main_view->getChildView("world_view_rect")->getHandle();
mNonSideTrayView = main_view->getChildView("non_side_tray_view")->getHandle();
mFloaterViewHolder = main_view->getChildView("floater_view_holder")->getHandle();
+ mPopupView = main_view->getChild<LLPopupView>("popup_holder");
// Constrain floaters to inside the menu and status bar regions.
gFloaterView = main_view->getChild<LLFloaterView>("Floater View");
gSnapshotFloaterView = main_view->getChild<LLSnapshotFloaterView>("Snapshot Floater View");
+
// Console
llassert( !gConsole );
LLConsole::Params cp;
@@ -2433,6 +2438,30 @@ void LLViewerWindow::handleScrollWheel(S32 clicks)
return;
}
+void LLViewerWindow::addPopup(LLView* popup)
+{
+ if (mPopupView)
+ {
+ mPopupView->addPopup(popup);
+ }
+}
+
+void LLViewerWindow::removePopup(LLView* popup)
+{
+ if (mPopupView)
+ {
+ mPopupView->removePopup(popup);
+ }
+}
+
+void LLViewerWindow::clearPopups()
+{
+ if (mPopupView)
+ {
+ mPopupView->clearPopups();
+ }
+}
+
void LLViewerWindow::moveCursorToCenter()
{
if (! gSavedSettings.getBOOL("DisableMouseWarp"))
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index bfce65f2ba..410445d97f 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -69,6 +69,7 @@ class LLHUDIcon;
class LLWindow;
class LLRootView;
class LLViewerWindowListener;
+class LLPopupView;
#define PICK_HALF_WIDTH 5
#define PICK_DIAMETER (2 * PICK_HALF_WIDTH + 1)
@@ -300,6 +301,11 @@ public:
BOOL handleKey(KEY key, MASK mask);
void handleScrollWheel (S32 clicks);
+ // add and remove views from "popup" layer
+ void addPopup(LLView* popup);
+ void removePopup(LLView* popup);
+ void clearPopups();
+
// Hide normal UI when a logon fails, re-show everything when logon is attempted again
void setNormalControlsVisible( BOOL visible );
void setMenuBackgroundColor(bool god_mode = false, bool dev_grid = false);
@@ -458,6 +464,7 @@ protected:
LLHandle<LLView> mWorldViewPlaceholder; // widget that spans the portion of screen dedicated to rendering the 3d world
LLHandle<LLView> mNonSideTrayView; // parent of world view + bottom bar, etc...everything but the side tray
LLHandle<LLView> mFloaterViewHolder; // container for floater_view
+ LLPopupView* mPopupView; // container for transient popups
class LLDebugText* mDebugText; // Internal class for debug text
@@ -477,7 +484,7 @@ protected:
private:
// Object temporarily hovered over while dragging
LLPointer<LLViewerObject> mDragHoveredObject;
-};
+};
void toggle_flying(void*);
void toggle_first_person();
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index 7b6081d7be..85853f39bb 100644
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -156,18 +156,19 @@
name="notify_container"
tab_group="-2"
width="1024"/>
- <menu_holder top="0"
- follows="all"
- height="768"
- mouse_opaque="false"
- name="Menu Holder"
- width="1024"/>
<panel top="0"
follows="all"
height="768"
mouse_opaque="false"
name="popup_holder"
+ class="popup_holder"
width="1024"/>
+ <menu_holder top="0"
+ follows="all"
+ height="768"
+ mouse_opaque="false"
+ name="Menu Holder"
+ width="1024"/>
<snapshot_floater_view enabled="false"
follows="all"
height="768"