diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-08-15 09:52:06 -0400 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-08-15 09:52:06 -0400 |
| commit | 57da9bcd1bba7cfc96f822540904edeb97416e7f (patch) | |
| tree | 0730cf33e552fa0c1e098c1915d7db4293069b81 /indra/newview/lltoastscriptquestion.cpp | |
| parent | 85a13b53f5570c44c476a7af70846874dfc3ecbf (diff) | |
| parent | 4fb100ac7a33174883184f1320d0beac08ead3a7 (diff) | |
merge from viewer-release
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); + } } } } |
