[Bf-committers] UI layout: Why 'align' property of layouts is inherited?

Bastien Montagne montagne29 at wanadoo.fr
Thu Aug 22 23:33:29 CEST 2013


Hi devs,

Was wondering, why 'align' layout flag is de-facto inherited for all 
most common layout types (rows, columns, etc.)? I won't pretend to have 
a complete understanding of the layout engine, but this is currently 
giving me white hair...

This very simple patch seems to fix this (afaict): 
http://www.pasteall.org/45073/diff

It will induce edits in UI (e.g. 3DView tools, where some group of 
options are currently drawn 'aligned' even though there immediate layout 
is not set so), but imho it makes much more sense this way.

Else it’s very confusing, especially as py code never know whether the 
layout given to it is aligned or not!

As I was in UI layout code, I also made "labelled items" (like e.g. 
string, non-expanded enums, etc.) sensible to current layout's direction 
(like expanded enums), so that the label is displayed above them when in 
vertical layout. This is what we already often do in py UI, using stupid 
UILayout.label calls for that. This simple change allows me e.g. to get 
rid of for label() calls in WeightEdit modifier's UI...

Best regards,
Bastien


More information about the Bf-committers mailing list