diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-09-10 23:21:56 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-09-10 23:21:56 +0300 |
commit | b31a93baa83dc232e331a0420800fcb6d7faa2d3 (patch) | |
tree | d19b0dcd8340aa15d3ecfb1156ca463ab9a495fc /indra/newview/lltoastpanel.cpp | |
parent | 83651c49dd42d32bed8f1a3583a61e9226f85f9e (diff) | |
parent | 05fcbb5df96c93fa2ba61411c34dcb097ab02c61 (diff) |
Upstream merge from lindenlab/viewer-neko
Diffstat (limited to 'indra/newview/lltoastpanel.cpp')
-rw-r--r-- | indra/newview/lltoastpanel.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/indra/newview/lltoastpanel.cpp b/indra/newview/lltoastpanel.cpp index d69f918a54..100d5ee713 100644 --- a/indra/newview/lltoastpanel.cpp +++ b/indra/newview/lltoastpanel.cpp @@ -161,7 +161,20 @@ void LLCheckBoxToastPanel::setCheckBoxes(const S32 &h_pad, const S32 &v_pad, LLV std::string ignore_label; LLNotificationFormPtr form = mNotification->getForm(); - if (form->getIgnoreType() == LLNotificationForm::IGNORE_WITH_DEFAULT_RESPONSE) + if (form->getIgnoreType() == LLNotificationForm::IGNORE_CHECKBOX_ONLY) + { + // Normally text is only used to describe notification in preferences, + // but this one is not displayed in preferences and works on case by case + // basis. + // Display text if present, display 'always chose' if not. + std::string ignore_message = form->getIgnoreMessage(); + if (ignore_message.empty()) + { + ignore_message = LLNotifications::instance().getGlobalString("alwayschoose"); + } + setCheckBox(ignore_message, ignore_label, boost::bind(&LLCheckBoxToastPanel::onCommitCheckbox, this, _1), h_pad, v_pad, parent_view); + } + else if (form->getIgnoreType() == LLNotificationForm::IGNORE_WITH_DEFAULT_RESPONSE) { setCheckBox(LLNotifications::instance().getGlobalString("skipnexttime"), ignore_label, boost::bind(&LLCheckBoxToastPanel::onCommitCheckbox, this, _1), h_pad, v_pad, parent_view); } @@ -211,7 +224,9 @@ bool LLCheckBoxToastPanel::setCheckBox(const std::string& check_title, // set check_box's attributes LLRect check_rect; - mCheck->setRect(check_rect.setOriginAndSize(msg_x, v_pad + BTN_HEIGHT + LINE_HEIGHT / 2, max_msg_width, LINE_HEIGHT*lines.size())); + // if we are part of the toast, we need to leave space for buttons + S32 msg_y = v_pad + (parent_view ? 0 : (BTN_HEIGHT + LINE_HEIGHT / 2)); + mCheck->setRect(check_rect.setOriginAndSize(msg_x, msg_y, max_msg_width, LINE_HEIGHT*lines.size())); mCheck->setLabel(check_title); mCheck->setCommitCallback(cb); |