GUI: Composite images shouldn't affect padding

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

GUI: Composite images shouldn't affect padding

Post by aubergine18 »

Currently the corner size of composite images on GUI elements adds to the padding, making it somewhat difficult to properly align things internally.

Ideally the only thing that should affect internal padding of a GUI element is the 4 padding properties.

EDIT: Alternatively, allow negative padding so we can optionally 'undo' padding added by corner size.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: GUI: Composite images shouldn't affect padding

Post by ssilk »

Ever heard of CSS? Containers in containers in containers?
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: GUI: Composite images shouldn't affect padding

Post by aubergine18 »

Yup, it would be a dream if factorio worked that way. But, for the most part, it doesn't :(

I can't successfully put other elements in to a button element for example. So if I wanted a button to just be a "clickable container" and then put say a glyph element and a label element in it, at the moment that doesn't work - those other elements appear outside the button and no way I've found to get them inside the button (or have the button act like a frame/flow and do that for me).

And I can't just use a frame for the background graphics, because frames only have single background state; there's no way to update them on hover etc. via style sheet.

I could go to the extreme lengths of having a frame containing a grid containing an unstyled glyph button and label, then use the frame background for border and the grid row color background on hover to mimic a hover state (although it's not graphical so severely limited in terms of design options) but that's so heinous I'd rather climb the Eiffel Tower with nothing but the suction power of my own lips.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Post Reply

Return to “Ideas and Suggestions”