Fix horizontal offset of stacked toast buttons when displayed within chat history (buttons going out of side instead of aligning to the left)

Tue, 06 Jan 2015 16:57:12 +0100

author
Ansariel
date
Tue, 06 Jan 2015 16:57:12 +0100
changeset 43102
2012c454de90
parent 43101
c237bb7b935c
child 43103
b7fc8ab4e21b

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 file | annotate | diff | revisions
     1.1 --- a/indra/newview/lltoastnotifypanel.cpp	Tue Jan 06 15:22:32 2015 +0100
     1.2 +++ b/indra/newview/lltoastnotifypanel.cpp	Tue Jan 06 16:57:12 2015 +0100
     1.3 @@ -503,6 +503,7 @@
     1.4  
     1.5  	const child_list_t* children = getControlPanel()->getChildList();
     1.6  	S32 offset = 0;
     1.7 +	S32 last_bottom = 0; // <FS:Ansariel> Fix stacked buttons offset
     1.8  	// Children were added by addChild() which uses push_front to insert them into list,
     1.9  	// so to get buttons in correct order reverse iterator is used (EXT-5906) 
    1.10  	for (child_list_t::const_reverse_iterator it = children->rbegin(); it != children->rend(); it++)
    1.11 @@ -510,6 +511,12 @@
    1.12  		LLButton * button = dynamic_cast<LLButton*> (*it);
    1.13  		if (button != NULL)
    1.14  		{
    1.15 +			// <FS:Ansariel> Fix stacked buttons offset
    1.16 +			if (last_bottom != button->getRect().mBottom)
    1.17 +			{
    1.18 +				offset = 0;
    1.19 +			}
    1.20 +			// </FS:Ansariel>
    1.21  			button->setOrigin( offset,button->getRect().mBottom);
    1.22  			button->setLeftHPad(2 * HPAD);
    1.23  			button->setRightHPad(2 * HPAD);
    1.24 @@ -522,6 +529,8 @@
    1.25  			button->autoResize();
    1.26  			offset += HPAD + button->getRect().getWidth();
    1.27  			button->setFollowsNone();
    1.28 +			// <FS:Ansariel> Fix stacked buttons offset
    1.29 +			last_bottom = button->getRect().mBottom;
    1.30  		}
    1.31  	}
    1.32  

mercurial