diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2016-08-04 21:11:32 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2016-08-04 21:11:32 +0300 |
commit | 6de863132756ffdf3778721ec9dd0f3a15bf464a (patch) | |
tree | 6bc5a3c515fe92cb785b7eaf9b6860e7e7110b61 /indra/newview/lltoastscriptquestion.cpp | |
parent | 2339e759fc2d6f36a4b9425022a22a747ec55dad (diff) | |
parent | ce3658455230cf392f45cc99f44a737ee59f13bd (diff) |
Merged in lindenlab/viewer-lynx
Diffstat (limited to 'indra/newview/lltoastscriptquestion.cpp')
-rw-r--r-- | indra/newview/lltoastscriptquestion.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/lltoastscriptquestion.cpp b/indra/newview/lltoastscriptquestion.cpp index 91ba8c0247..7a3a1d8fd7 100644 --- a/indra/newview/lltoastscriptquestion.cpp +++ b/indra/newview/lltoastscriptquestion.cpp @@ -54,6 +54,19 @@ BOOL LLToastScriptQuestion::postBuild() return TRUE; } + +// virtual +void LLToastScriptQuestion::setFocus(BOOL b) +{ + LLToastPanel::setFocus(b); + // toast can fade out and disappear with focus ON, so reset to default anyway + LLButton* dfbutton = getDefaultButton(); + if (dfbutton && dfbutton->getVisible() && dfbutton->getEnabled()) + { + dfbutton->setFocus(b); + } +} + void LLToastScriptQuestion::snapToMessageHeight() { LLTextBox* mMessage = getChild<LLTextBox>("top_info_message"); @@ -118,6 +131,12 @@ void LLToastScriptQuestion::createButtons() button->setRect(rect); buttons_width += rect.getWidth() + LEFT_PAD; + + if (form_element.has("default") && form_element["default"].asBoolean()) + { + button->setFocus(TRUE); + setDefaultBtn(button); + } } } } |