Page 1 of 1

Right align for GUI in 0.15

Posted: Thu Dec 01, 2016 6:45 am
by Mooncat
Request:
A true way to make right-aligned GUI.

Reason:
Although there can be align="right" in style prototype, it only works internally. If it is applied to button style, it means the text inside the button will be right-aligned, but not the button.

To make right-aligned GUI with the current API, we need to fix the width of the parent element as well as the width of the element itself, so we can calculate how much to put in its left-padding. But if there is a scrollbar that is not always shown, the parent width will vary and hence this approach of right alignment doesn't work, no mention it is troublesome.

Since you are improving the GUI system in 0.15, I hope there will be a better way to do right alignment. :D

(After seeing the recent GUI request, I finally remember to make this one. Hopefully it is not too late.)

Re: Right align for GUI in 0.15

Posted: Thu Dec 01, 2016 11:55 am
by Rseding91
That's how our GUI work. Saying "align right" only ever aligns the contents of that GUI element to the right. You need to say "align right" on the container that holds the GUI element.

Re: Right align for GUI in 0.15

Posted: Thu Dec 01, 2016 2:22 pm
by Mooncat
Rseding91 wrote:That's how our GUI work. Saying "align right" only ever aligns the contents of that GUI element to the right. You need to say "align right" on the container that holds the GUI element.
I remember I have tried applying align="right" to flow but nothing happened. Is it a bug if I can confirm it?
And how do you handle dynamic parent size?