From 894725f3314d24c20414a9a2491cf0cd59882788 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 5 Sep 2019 17:15:23 +0300 Subject: SL-11315 Checkbox support for notifications --- indra/newview/lltoastnotifypanel.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'indra/newview/lltoastnotifypanel.cpp') diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index a2116817a2..65684dc2fd 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -33,6 +33,7 @@ // library includes #include "lldbstrings.h" +#include "llcheckboxctrl.h" #include "lllslconstants.h" #include "llnotifications.h" #include "lluiconstants.h" @@ -55,7 +56,7 @@ const LLFontGL* LLToastNotifyPanel::sFontSmall = NULL; LLToastNotifyPanel::button_click_signal_t LLToastNotifyPanel::sButtonClickSignal; LLToastNotifyPanel::LLToastNotifyPanel(const LLNotificationPtr& notification, const LLRect& rect, bool show_images) -: LLToastPanel(notification), +: LLCheckBoxToastPanel(notification), LLInstanceTracker(notification->getID()) { init(rect, show_images); @@ -409,7 +410,17 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) //.xml file intially makes info panel only follow left/right/top. This is so that when control buttons are added the info panel //can shift upward making room for the buttons inside mControlPanel. After the buttons are added, the info panel can then be set to follow 'all'. mInfoPanel->setFollowsAll(); - snapToMessageHeight(mTextBox, LLToastPanel::MAX_TEXT_LENGTH); + + // Add checkboxes if nessesary. + setCheckBoxes(HPAD * 3, VPAD * 4, mInfoPanel); + + // Snap to message, then to checkbox if present + snapToMessageHeight(mTextBox, LLToastPanel::MAX_TEXT_LENGTH); + if (mCheck) + { + S32 new_panel_height = mCheck->getRect().getHeight() + getRect().getHeight(); + reshape(getRect().getWidth(), new_panel_height); + } // reshape the panel to its previous size if (current_rect.notEmpty()) -- cgit v1.2.3 From 611e0a2e38d624ed22270f2148323c320df5cc39 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 9 Sep 2019 18:31:55 +0300 Subject: SL-11315 Fix paddings for checkbox --- indra/newview/lltoastnotifypanel.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview/lltoastnotifypanel.cpp') diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 65684dc2fd..83009a78d4 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -411,14 +411,17 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) //can shift upward making room for the buttons inside mControlPanel. After the buttons are added, the info panel can then be set to follow 'all'. mInfoPanel->setFollowsAll(); - // Add checkboxes if nessesary. - setCheckBoxes(HPAD * 3, VPAD * 4, mInfoPanel); - + // Add checkbox (one of couple types) if nessesary. + setCheckBoxes(HPAD * 3, 0, mInfoPanel); + if (mCheck) + { + mCheck->setFollows(FOLLOWS_BOTTOM | FOLLOWS_LEFT); + } // Snap to message, then to checkbox if present snapToMessageHeight(mTextBox, LLToastPanel::MAX_TEXT_LENGTH); if (mCheck) { - S32 new_panel_height = mCheck->getRect().getHeight() + getRect().getHeight(); + S32 new_panel_height = mCheck->getRect().getHeight() + getRect().getHeight() + VPAD; reshape(getRect().getWidth(), new_panel_height); } -- cgit v1.2.3 From e29b3605c31e2e1cbbc932ce75b327f98b70f513 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 5 Sep 2019 17:15:57 +0300 Subject: SL-11315 Viewer asks to play media and retains selected choice --- indra/newview/lltoastnotifypanel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/lltoastnotifypanel.cpp') diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 83009a78d4..bccf88128d 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -163,6 +163,11 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vector max_width)// whether there is still some place for button+h_pad in the mControlPanel { // looks like we need to add button to the next row @@ -412,7 +417,7 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) mInfoPanel->setFollowsAll(); // Add checkbox (one of couple types) if nessesary. - setCheckBoxes(HPAD * 3, 0, mInfoPanel); + setCheckBoxes(HPAD * 2, 0, mInfoPanel); if (mCheck) { mCheck->setFollows(FOLLOWS_BOTTOM | FOLLOWS_LEFT); -- cgit v1.2.3