summaryrefslogtreecommitdiff
path: root/indra/newview/lltoastscriptquestion.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-09-02 14:34:06 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-09-02 14:34:06 -0400
commita2875ba53ec02235a0db5734264108c0f0898269 (patch)
treef9dc66183550cda2c3478f72fa7018094da3cd19 /indra/newview/lltoastscriptquestion.cpp
parent227eb6c4a49724fe513f5d67af68d355d173f951 (diff)
parentd07a8b9965b54fca34b239a51af46b996a58d553 (diff)
merge
Diffstat (limited to 'indra/newview/lltoastscriptquestion.cpp')
-rw-r--r--indra/newview/lltoastscriptquestion.cpp19
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);
+ }
}
}
}