summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAlexei Arabadji <aarabadji@productengine.com>2010-06-17 17:01:47 +0300
committerAlexei Arabadji <aarabadji@productengine.com>2010-06-17 17:01:47 +0300
commitebf78baa42dd3cd641b9c676be896c603fe66df8 (patch)
tree9dd88a58a8925001bbd0f142cc46d4535092bb7b /indra/newview
parenteb973cf6b21457c12272ddb6213e99d332637116 (diff)
parentcdafe7cef5cb7a9823e34e563cdc2cc498664c53 (diff)
Automated merge with https://hg.productengine.com/secondlife/viewer-release/
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lltoastalertpanel.cpp83
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml2
2 files changed, 55 insertions, 30 deletions
diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp
index db1f4dc4cb..7ba256c870 100644
--- a/indra/newview/lltoastalertpanel.cpp
+++ b/indra/newview/lltoastalertpanel.cpp
@@ -247,35 +247,6 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
msg_box->setRect( rect );
LLToastPanel::addChild(msg_box);
- // Buttons
- S32 button_left = (LLToastPanel::getRect().getWidth() - btn_total_width) / 2;
-
- for( S32 i = 0; i < num_options; i++ )
- {
- LLRect button_rect;
-
- LLButton* btn = LLUICtrlFactory::getInstance()->createFromFile<LLButton>("alert_button.xml", this, LLPanel::child_registry_t::instance());
- if(btn)
- {
- btn->setName(options[i].first);
- btn->setRect(button_rect.setOriginAndSize( button_left, VPAD, button_width, BTN_HEIGHT ));
- btn->setLabel(options[i].second);
- btn->setFont(font);
-
- btn->setClickedCallback(boost::bind(&LLToastAlertPanel::onButtonPressed, this, _2, i));
-
- mButtonData[i].mButton = btn;
-
- LLToastPanel::addChild(btn);
-
- if( i == mDefaultOption )
- {
- btn->setFocus(TRUE);
- }
- }
- button_left += button_width + BTN_HPAD;
- }
-
// (Optional) Edit Box
if (!edit_text_name.empty())
{
@@ -307,9 +278,63 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
mLineEditor->setDrawAsterixes(is_password);
setEditTextArgs(notification->getSubstitutions());
+
+ mLineEditor->setFollowsLeft();
+ mLineEditor->setFollowsRight();
+
+ // find form text input field
+ LLSD form_text;
+ for (LLSD::array_const_iterator it = form_sd.beginArray(); it != form_sd.endArray(); ++it)
+ {
+ std::string type = (*it)["type"].asString();
+ if (type == "text")
+ {
+ form_text = (*it);
+ }
+ }
+
+ // if form text input field has width attribute
+ if (form_text.has("width"))
+ {
+ // adjust floater width to fit line editor
+ S32 editor_width = form_text["width"];
+ LLRect editor_rect = mLineEditor->getRect();
+ U32 width_delta = editor_width - editor_rect.getWidth();
+ LLRect toast_rect = getRect();
+ reshape(toast_rect.getWidth() + width_delta, toast_rect.getHeight());
+ }
}
}
+ // Buttons
+ S32 button_left = (LLToastPanel::getRect().getWidth() - btn_total_width) / 2;
+
+ for( S32 i = 0; i < num_options; i++ )
+ {
+ LLRect button_rect;
+
+ LLButton* btn = LLUICtrlFactory::getInstance()->createFromFile<LLButton>("alert_button.xml", this, LLPanel::child_registry_t::instance());
+ if(btn)
+ {
+ btn->setName(options[i].first);
+ btn->setRect(button_rect.setOriginAndSize( button_left, VPAD, button_width, BTN_HEIGHT ));
+ btn->setLabel(options[i].second);
+ btn->setFont(font);
+
+ btn->setClickedCallback(boost::bind(&LLToastAlertPanel::onButtonPressed, this, _2, i));
+
+ mButtonData[i].mButton = btn;
+
+ LLToastPanel::addChild(btn);
+
+ if( i == mDefaultOption )
+ {
+ btn->setFocus(TRUE);
+ }
+ }
+ button_left += button_width + BTN_HPAD;
+ }
+
std::string ignore_label;
if (form->getIgnoreType() == LLNotificationForm::IGNORE_WITH_DEFAULT_RESPONSE)
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 20a2a7d954..673c095826 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -2098,7 +2098,7 @@ Would you be my friend?
type="alertmodal">
New outfit name:
<form name="form">
- <input name="new_name" type="text">
+ <input name="new_name" type="text" width="300">
[NAME]
</input>
<button