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/lltoastnotifypanel.cpp | |
parent | 83651c49dd42d32bed8f1a3583a61e9226f85f9e (diff) | |
parent | 05fcbb5df96c93fa2ba61411c34dcb097ab02c61 (diff) |
Upstream merge from lindenlab/viewer-neko
Diffstat (limited to 'indra/newview/lltoastnotifypanel.cpp')
-rw-r--r-- | indra/newview/lltoastnotifypanel.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 65684dc2fd..bccf88128d 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -163,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 @@ -411,14 +416,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 * 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(); + S32 new_panel_height = mCheck->getRect().getHeight() + getRect().getHeight() + VPAD; reshape(getRect().getWidth(), new_panel_height); } |