summaryrefslogtreecommitdiff
path: root/indra/newview/lltoastalertpanel.cpp
diff options
context:
space:
mode:
authorcallum_linden <none@none>2017-08-22 14:32:04 -0700
committercallum_linden <none@none>2017-08-22 14:32:04 -0700
commitb5dbb9c52aa8f9379662f1ff1169adadcf8ac5f8 (patch)
tree438d099240df63608825568d162874e186835994 /indra/newview/lltoastalertpanel.cpp
parent8e6751efced8d9f5ede5ec5d954ff809d56d1162 (diff)
parent58176de9574164e31790a148d9b5489a129fc961 (diff)
Automated merge with head of ll/viewer64 after DRTVWR-439 merge
Diffstat (limited to 'indra/newview/lltoastalertpanel.cpp')
-rw-r--r--indra/newview/lltoastalertpanel.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp
index bbce717c20..495c9c1f44 100644
--- a/indra/newview/lltoastalertpanel.cpp
+++ b/indra/newview/lltoastalertpanel.cpp
@@ -46,6 +46,8 @@
#include "lltransientfloatermgr.h"
#include "llviewercontrol.h" // for gSavedSettings
+#include <boost/algorithm/string.hpp>
+
const S32 MAX_ALLOWED_MSG_WIDTH = 400;
const F32 DEFAULT_BUTTON_DELAY = 0.5f;
@@ -351,6 +353,10 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
{
setCheckBox(LLNotifications::instance().getGlobalString("skipnexttime"), ignore_label);
}
+ if (form->getIgnoreType() == LLNotificationForm::IGNORE_WITH_DEFAULT_RESPONSE_SESSION_ONLY)
+ {
+ setCheckBox(LLNotifications::instance().getGlobalString("skipnexttimesessiononly"), ignore_label);
+ }
else if (form->getIgnoreType() == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE)
{
setCheckBox(LLNotifications::instance().getGlobalString("alwayschoose"), ignore_label);
@@ -385,15 +391,18 @@ bool LLToastAlertPanel::setCheckBox( const std::string& check_title, const std::
const LLFontGL* font = mCheck->getFont();
const S32 LINE_HEIGHT = font->getLineHeight();
+
+ std::vector<std::string> lines;
+ boost::split(lines, check_title, boost::is_any_of("\n"));
// Extend dialog for "check next time"
S32 max_msg_width = LLToastPanel::getRect().getWidth() - 2 * HPAD;
- S32 check_width = S32(font->getWidth(check_title) + 0.99f) + 16;
+ S32 check_width = S32(font->getWidth(lines[0]) + 0.99f) + 16; // use width of the first line
max_msg_width = llmax(max_msg_width, check_width);
S32 dialog_width = max_msg_width + 2 * HPAD;
S32 dialog_height = LLToastPanel::getRect().getHeight();
- dialog_height += LINE_HEIGHT;
+ dialog_height += LINE_HEIGHT * lines.size();
dialog_height += LINE_HEIGHT / 2;
LLToastPanel::reshape( dialog_width, dialog_height, FALSE );
@@ -402,7 +411,7 @@ bool LLToastAlertPanel::setCheckBox( const std::string& check_title, const std::
// set check_box's attributes
LLRect check_rect;
- mCheck->setRect(check_rect.setOriginAndSize(msg_x, VPAD+BTN_HEIGHT+LINE_HEIGHT/2, max_msg_width, LINE_HEIGHT));
+ mCheck->setRect(check_rect.setOriginAndSize(msg_x, VPAD+BTN_HEIGHT+LINE_HEIGHT/2, max_msg_width, LINE_HEIGHT*lines.size()));
mCheck->setLabel(check_title);
mCheck->setCommitCallback(boost::bind(&LLToastAlertPanel::onClickIgnore, this, _1));