I have two nested frames (outer_frame and inner_frame) and am trying to understand how horizontally_stretchable changes the layout, when setting it on inner_frame:
Code: Select all
local window = player.gui.screen.add {
type = 'frame'
}
window.style.size = 150
window.force_auto_center()
local outer_frame = window.add {
type = 'frame',
style = 'inside_shallow_frame_with_padding'
}
outer_frame.style.horizontally_stretchable = true
outer_frame.style.vertically_stretchable = true
local inner_frame = outer_frame.add {
type = 'frame',
style = 'deep_frame_in_shallow_frame'
}
inner_frame.style.natural_width = 50
inner_frame.style.maximal_width = 70
inner_frame.style.horizontally_stretchable = true -- this is the line I am talking about
inner_frame.style.vertically_stretchable = true
The inner frame has its natural width and stretches vertically and the outer frame completely fills the window. However, when I set inner_frame.style.horizontally_stretchable = true, it looks like this:
The inner frame behaves as expected (it stretches to its maximal width), but the outer frame no longer stretches to the full width of the window. I would expect for the outer frame to stay the same (i.e. fill the window completely), as I have only changed the stretching behavior of the inner frame. What's also making me think this might be a bug is that I can add direction = 'vertical' to the outer frame, and that causes the outer frame to completely fill the window again.