Hey Florian,

2012/8/1 Florian Zirker <[email protected]>:
> I have two WTableViews in an WHBoxLayout. Between the tables is a
> Container with 2 Buttons. The left Table has 3 Columns, but the right
> Table has only one Column.
> I want that the right table is twice as large as the left. So I inserted
> the left table with a stretch factor of 1 and the right table with a
> factor of 2.
>
> Now witty ignores the stretch factor and paints the left table larger,
> because this table has more columns.
> What do I need to do, that the tables are sized correctly?

The preferred width of the left table will indeed be larger than the
preferred width of the second table, and excess space will only be
distributed according to the stretch factor.

I'm not sure if we need to change this policy since this is indeed a
behavior that is desired in many (most?) cases.

However, in your case, you can trick the layout manager: by setting
the width of the left tableview to a big number (1000) and the width
of the right tableview to double (2000), the layout manager will need
to reduce both tables in size to fit inside the layout, and will do
this proportionally to their (preferred width - minimum width).

http://pastebin.com/AyyUagL0

With this change, I get the behavior you're after. I'm wondering now
if there needs more explicit API support for this (e.g. to ignore
nested layout size measurement for a widget and take the set width as
preferred width).

Regards,
koen

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to