summaryrefslogtreecommitdiff
path: root/indra/llui/llmodaldialog.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-06-21 08:04:56 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-06-21 08:04:56 +0000
commit9ec432034dc3c45d7ce763eb02dae4cc7f6b8da8 (patch)
tree4a505c1e0919af52800b3ffb3eaf135e7d6f9ce6 /indra/llui/llmodaldialog.cpp
parent351ebe9fcb76f3b99c2957004bb8493a904869ee (diff)
merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3
ignore-dead-branch
Diffstat (limited to 'indra/llui/llmodaldialog.cpp')
-rw-r--r--indra/llui/llmodaldialog.cpp48
1 files changed, 15 insertions, 33 deletions
diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp
index 1662ff7db6..8779eee28d 100644
--- a/indra/llui/llmodaldialog.cpp
+++ b/indra/llui/llmodaldialog.cpp
@@ -45,17 +45,16 @@
std::list<LLModalDialog*> LLModalDialog::sModalStack;
LLModalDialog::LLModalDialog( const std::string& title, S32 width, S32 height, BOOL modal )
- : LLFloater( std::string("modal container"),
- LLRect( 0, height, width, 0 ),
- title,
- FALSE, // resizable
- DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT,
- FALSE, // drag_on_left
- modal ? FALSE : TRUE, // minimizable
- modal ? FALSE : TRUE, // close button
- TRUE), // bordered
+ : LLFloater(),
mModal( modal )
{
+ setRect(LLRect( 0, height, width, 0 ));
+ setTitle(title);
+ if (modal)
+ {
+ setCanMinimize(FALSE);
+ setCanClose(FALSE);
+ }
setVisible( FALSE );
setBackgroundVisible(TRUE);
setBackgroundOpaque(TRUE);
@@ -72,12 +71,12 @@ LLModalDialog::~LLModalDialog()
}
// virtual
-void LLModalDialog::open() /* Flawfinder: ignore */
+void LLModalDialog::openFloater(const LLSD& key)
{
// SJB: Hack! Make sure we don't ever host a modal dialog
LLMultiFloater* thost = LLFloater::getFloaterHost();
LLFloater::setFloaterHost(NULL);
- LLFloater::open();
+ LLFloater::openFloater(key);
LLFloater::setFloaterHost(thost);
}
@@ -229,7 +228,7 @@ BOOL LLModalDialog::handleKeyHere(KEY key, MASK mask )
BOOL enough_time_elapsed = mVisibleTime.getElapsedTimeF32() > 1.0f;
if (enough_time_elapsed && key == KEY_ESCAPE)
{
- close();
+ closeFloater();
return TRUE;
}
return FALSE;
@@ -245,32 +244,15 @@ void LLModalDialog::onClose(bool app_quitting)
// virtual
void LLModalDialog::draw()
{
- LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow");
- S32 shadow_lines = LLUI::sConfigGroup->getS32("DropShadowFloater");
+ static LLUICachedControl<LLColor4> shadow_color ("ColorDropShadow", *(new LLColor4));
+ static LLUICachedControl<S32> shadow_lines ("DropShadowFloater", 0);
gl_drop_shadow( 0, getRect().getHeight(), getRect().getWidth(), 0,
shadow_color, shadow_lines);
LLFloater::draw();
-
- if (mModal)
- {
- // If we've lost focus to a non-child, get it back ASAP.
- if( gFocusMgr.getTopCtrl() != this )
- {
- gFocusMgr.setTopCtrl( this );
- }
-
- if( !gFocusMgr.childHasKeyboardFocus( this ) )
- {
- setFocus(TRUE);
- }
-
- if( !gFocusMgr.childHasMouseCapture( this ) )
- {
- gFocusMgr.setMouseCapture( this );
- }
- }
+
+ // Focus retrieval moved to LLFloaterView::refresh()
}
void LLModalDialog::centerOnScreen()