diff options
author | Merov Linden <merov@lindenlab.com> | 2012-05-08 10:18:03 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2012-05-08 10:18:03 -0700 |
commit | 60f602d5e12a50623b51b13e097992f79006823f (patch) | |
tree | 386e3cf5b25f3292e3ba7c8a9b0524c5bfbb9589 /indra/newview/lltoastalertpanel.cpp | |
parent | 29da931051202a10ea71db56e47acecae1603a5d (diff) | |
parent | ccb86a2a6675b21dda6267d4a850e5a09acbafa4 (diff) |
Pull from VirLinden/drano
Diffstat (limited to 'indra/newview/lltoastalertpanel.cpp')
-rw-r--r-- | indra/newview/lltoastalertpanel.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 0f337825e9..8fef2ed6d1 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -69,8 +69,22 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal mLabel(notification->getName()), mLineEditor(NULL) { + // EXP-1822 + // save currently focused view, so that return focus to it + // on destroying this toast. + LLView* current_selection = dynamic_cast<LLView*>(gFocusMgr.getKeyboardFocus()); + while(current_selection) + { + if (current_selection->isFocusRoot()) + { + mPreviouslyFocusedView = current_selection->getHandle(); + break; + } + current_selection = current_selection->getParent(); + } + const LLFontGL* font = LLFontGL::getFontSansSerif(); - const S32 LINE_HEIGHT = llfloor(font->getLineHeight() + 0.99f); + const S32 LINE_HEIGHT = font->getLineHeight(); const S32 EDITOR_HEIGHT = 20; LLNotificationFormPtr form = mNotification->getForm(); @@ -365,7 +379,7 @@ bool LLToastAlertPanel::setCheckBox( const std::string& check_title, const std:: } const LLFontGL* font = mCheck->getFont(); - const S32 LINE_HEIGHT = llfloor(font->getLineHeight() + 0.99f); + const S32 LINE_HEIGHT = font->getLineHeight(); // Extend dialog for "check next time" S32 max_msg_width = LLToastPanel::getRect().getWidth() - 2 * HPAD; @@ -408,6 +422,13 @@ LLToastAlertPanel::~LLToastAlertPanel() { LLTransientFloaterMgr::instance().removeControlView( LLTransientFloaterMgr::GLOBAL, this); + + // EXP-1822 + // return focus to the previously focused view if the viewer is not exiting + if (mPreviouslyFocusedView.get() && !LLApp::isExiting()) + { + mPreviouslyFocusedView.get()->setFocus(TRUE); + } } BOOL LLToastAlertPanel::hasTitleBar() const |