Frame in table always stretching to row height
Posted: Sat Feb 02, 2019 2:09 pm
I am trying to put a frame into the center of a table cell.
This code
produces this:
I would like the frame inside the table to behave exactly like the one outside, i.e. stretching around its contents, but not to fill its parent. Apparently vertically_stretchable is ignored inside tables? The only way I found is to set the frame's maximal_height property, but I don't know the size of the frame's contents in advance. Any suggestions?
This code
Code: Select all
-- flow, just to draw red border in debug view
local testflow = self:get(pind).add{type = "flow", name ="test", direction = "horizontal"}
-- table
local testtb = testflow.add{type = "table", name ="test", column_count = 2}
-- a large label forcing the table row height to 100
local testlb = testtb.add{type = "label", caption = "LABEL"}
testlb.style.height = 100
-- a frame inside the cell next to the label
local testframe = testtb.add{type = "frame", caption = "frame in table"}
testframe.style.vertically_stretchable = false
-- a frame outside the table
testframe = testflow.add{type = "frame", caption = "frame outside of table"}
testframe.style.vertically_stretchable = false