From dcb6a850aae7692f66ffe156637264b910007b14 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 25 Jul 2017 03:18:59 +0300 Subject: MAINT-7356 Improved the notification appearance --- indra/newview/lltoastalertpanel.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/lltoastalertpanel.cpp') diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index bbce717c20..dbf0893e43 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -351,6 +351,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); -- cgit v1.2.3 From 7e746e9221bf90466644999364b3c3cc16c0af98 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Fri, 28 Jul 2017 08:17:19 +0300 Subject: MAINT-7356 Improved multiline label support for the notification toast checkbox --- indra/newview/lltoastalertpanel.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/newview/lltoastalertpanel.cpp') diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index dbf0893e43..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 + const S32 MAX_ALLOWED_MSG_WIDTH = 400; const F32 DEFAULT_BUTTON_DELAY = 0.5f; @@ -389,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 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 ); @@ -406,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)); -- cgit v1.2.3