summaryrefslogtreecommitdiff
path: root/indra/newview/lltoastnotifypanel.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-02-05 18:33:53 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-02-05 18:33:53 +0200
commitd956c866cf5f633668f6e81996f7ddb8481eae1c (patch)
treedc85377a9d88ef39326df005e0b5047792466ec7 /indra/newview/lltoastnotifypanel.cpp
parent1d1f2e95f2da9cd530f2336a8e661d16a512c064 (diff)
parent2998552f3d7447da316afdd1713595528596a0c5 (diff)
Merge branch 'master' into DRTVWR-483
Diffstat (limited to 'indra/newview/lltoastnotifypanel.cpp')
-rw-r--r--indra/newview/lltoastnotifypanel.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index a2116817a2..bccf88128d 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<LLToastNotifyPanel, LLUUID, LLInstanceTrackerReplaceOnCollision>(notification->getID())
{
init(rect, show_images);
@@ -162,6 +163,11 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vector<index_button_pair
{
left = (max_width - btn_rect.getWidth()) / 2;
}
+ else if (left == 0 && buttons.size() == 2)
+ {
+ // Note: this and "size() == 1" shouldn't be inside the cycle, might be good idea to refactor whole placing process
+ left = (max_width - (btn_rect.getWidth() * 2) - h_pad) / 2;
+ }
else if (left + btn_rect.getWidth() > 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
@@ -409,7 +415,20 @@ 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 checkbox (one of couple types) if nessesary.
+ setCheckBoxes(HPAD * 2, 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() + VPAD;
+ reshape(getRect().getWidth(), new_panel_height);
+ }
// reshape the panel to its previous size
if (current_rect.notEmpty())