Right align for GUI in 0.15

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Right align for GUI in 0.15

Post 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.)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14250
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Right align for GUI in 0.15

Post 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.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Right align for GUI in 0.15

Post 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?
Post Reply

Return to “Modding interface requests”