From 8335dcb097d204060c6eef1c2d81b6a7e27da056 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 6 Jan 2015 16:57:12 +0100 Subject: [PATCH] Fix horizontal offset of stacked toast buttons when displayed within chat history (buttons going out of side instead of aligning to the left) --- indra/newview/lltoastnotifypanel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index aa3ca68980..5d23590413 100755 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -503,6 +503,7 @@ void LLIMToastNotifyPanel::compactButtons() const child_list_t* children = getControlPanel()->getChildList(); S32 offset = 0; + S32 last_bottom = 0; // Fix stacked buttons offset // Children were added by addChild() which uses push_front to insert them into list, // so to get buttons in correct order reverse iterator is used (EXT-5906) for (child_list_t::const_reverse_iterator it = children->rbegin(); it != children->rend(); it++) @@ -510,6 +511,12 @@ void LLIMToastNotifyPanel::compactButtons() LLButton * button = dynamic_cast (*it); if (button != NULL) { + // Fix stacked buttons offset + if (last_bottom != button->getRect().mBottom) + { + offset = 0; + } + // button->setOrigin( offset,button->getRect().mBottom); button->setLeftHPad(2 * HPAD); button->setRightHPad(2 * HPAD); @@ -522,6 +529,8 @@ void LLIMToastNotifyPanel::compactButtons() button->autoResize(); offset += HPAD + button->getRect().getWidth(); button->setFollowsNone(); + // Fix stacked buttons offset + last_bottom = button->getRect().mBottom; } }