turbobadger icon indicating copy to clipboard operation
turbobadger copied to clipboard

TBLayout: one fixed item and one item take remaining space

Open jeduden opened this issue 6 years ago • 1 comments

I am trying to figure out how to configure TBLayout to have one item with a preferred width and another item next to it taking the remaining space. So a similar to the case of the mover, where the titlebar should take a all space except for the space the close button occupies. https://github.com/fruxo/turbobadger/blob/master/src/tb/tb_window.cpp#L253 Unfortunately, there the layout is down manually. I tried several settings with gravity, distribution etc. non produced the expected result. I am probably missing something.

jeduden avatar Feb 21 '18 07:02 jeduden

You could use distribution gravity, as shown in the demo (see test_layout02.tb.txt)

It will respect the preferred, min and max size, so as long as the widget that should take up all space is fine with that it will work directly. If not, you could override it by giving the widget "lp: max-width: 10000dp" to force allow it to expand.

fruxo avatar Feb 21 '18 07:02 fruxo