diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-05-08 07:43:08 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-05-08 07:43:08 +0000 |
commit | a4000c3744e42fcbb638e742f3b63fa31a0dee15 (patch) | |
tree | 7f472c30e65bbfa04ee9bc06631a1af305cc31fb /indra/llui/llmodaldialog.cpp | |
parent | 6c4cadbb04d633ad7b762058bdeba6e1f650dafd (diff) |
merge trunk@116587 skinning-7@119389 -> viewer-2.0.0-skinning-7
Diffstat (limited to 'indra/llui/llmodaldialog.cpp')
-rw-r--r-- | indra/llui/llmodaldialog.cpp | 48 |
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() |