I have a gui frame with children inside, the frame extends well below the last child. I have not been able to figure out how to shorten the frame.
Cut from the red line down:
frame_style =
{
type = "frame_style",
font = "default-frame",
font_color = {r=1, g=1, b=1},
-- padding of the title area of the frame, when the frame title
-- is empty, the area doesn't exist and these values are not used
title_top_padding = 0,
title_left_padding = 0,
title_bottom_padding = 15,
title_right_padding = 0,
-- padding of the content area of the frame
top_padding = default_container_padding - 6,
right_padding = default_container_padding,
bottom_padding = default_container_padding,
left_padding = default_container_padding,
graphical_set =
{
type = "composition",
filename = "__core__/graphics/gui.png",
priority = "extra-high-no-scale",
corner_size = {3, 3},
position = {8, 0}
},
flow_style=
{
horizontal_spacing = default_container_padding,
vertical_spacing = default_container_padding
}
}
on a side issue (maybe related) I'm not even sure how there are two columns. I used to have the children in a table but have since removed the table. Could each child element be adding to the vertical length?
Re: GUI frame vertical lengh too long
Posted: Fri Sep 02, 2016 9:37 pm
by osldgoth
perhaps I have discovered something.
if I remove the caption on the frame the child elements extend to the bottom edge of the frame:
no caption
if I make the caption much longer, the frame becomes wider allowing the child elements to reposition making fewer rows, but the frame height stays the same:
long caption
Is that a bug? my thought is that the frame height would be dynamic like frame width seems to be. or is there some frame setting I need to use?
Re: GUI frame vertical lengh too long
Posted: Fri Sep 02, 2016 9:54 pm
by Helfima
If u use a vertical frame, it try put all children in vertical before
2 way for ur problem
Use a table type guielement with 2 column
Or use a horizontal flow for label and button by row
Re: GUI frame vertical lengh too long
Posted: Sat Sep 03, 2016 2:32 am
by osldgoth
Nevermind, I figured it out, all I need to do is have each "sprite-button"/"button" pair add to maximal_height.