Fix horizontal offset of stacked toast buttons when displayed within chat history (buttons going out of side instead of aligning to the left)
parent
fd76ff405d
commit
8335dcb097
|
|
@ -503,6 +503,7 @@ void LLIMToastNotifyPanel::compactButtons()
|
|||
|
||||
const child_list_t* children = getControlPanel()->getChildList();
|
||||
S32 offset = 0;
|
||||
S32 last_bottom = 0; // <FS:Ansariel> 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<LLButton*> (*it);
|
||||
if (button != NULL)
|
||||
{
|
||||
// <FS:Ansariel> Fix stacked buttons offset
|
||||
if (last_bottom != button->getRect().mBottom)
|
||||
{
|
||||
offset = 0;
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
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();
|
||||
// <FS:Ansariel> Fix stacked buttons offset
|
||||
last_bottom = button->getRect().mBottom;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue