[Bf-taskforce25] Work planning & layout engine

Ton Roosendaal ton at blender.org
Sun Apr 5 15:30:51 CEST 2009


Hi,

I went with Brecht over the todos, and here's some notes and planning 
for next weeks.

Brecht will continue with the Layout Engine.
I will continue work on drawing code, cleanup code for it, make buttons 
scalable, redo Node drawing, make the themes editable, and then 
continue implementing UIs like the toolbar/properties window and button 
templates.

General target is that by the end of the month we should have a usable 
system, including script API to define the UIs.

Notes:

- User presets

Independent of styles or themes, a user can define the standard text 
height, like a font point size (10, 12 etc), which also defines default 
button or header heights. This allows adjusting the entire UI to the 
size/DPI of your screen, or adjust for screen recording or 
presentations. Ideally the standard icon set gets rasterized on this 
resolution too.
Zooming in/out on buttons will be relative to this scale definition.


- "Style"

This is a complete set of layout rules, the 'state' of the Layout 
Engine. Multiple styles are possible, defined via C or Python. Styles 
get a name, and will typically get activated per region type, like 
"Header", or "Listview" or "Toolbar". Properties of Style definitions 
are:

- default collumn properties, internal spacing, aligning, min/max width
- button alignment rules (for groups)
- label placement rules
- internal labeling or external labeling default
- default minimum widths for buttons/labels (in amount of characters)
- font types, styles and relative sizes for Panel titles, labels, etc.


- "Theme"

Independent of Style, a user can define which theme is in use. A theme 
definition offers:

- Backdrop color, menu backdrop color, label colors
- Color conventions per widget type
- Widget shape presets
- Icon set (built-in, external)

There's a limited amount of freely definable widget drawing aspects 
here, since many properties are derived from widget functionality too. 
It's useful to have arrows on 'number buttons', or arrows on popup 
buttons, have icons in front of names if it's "linkage" data for 
drag/drop, etc.


- "Hints"

While defining UIs in Pyton/C, a set of commands allow to further 
define the layout. In fact, most of the individual Style definitions 
can be tweaked or overridden here.

- amount of collums
- alignment and spacing rules
- different button size/height
- label conventions
- enforce specific widget types ("Normal" button, etc)


- "Templates"

A default set of templates will enable to define groups of buttons, 
based on specific data properties they share. A template will 
internally use the Styles and Themes as active, using own 'Hints' 
though.
Examples are:

- Object Loc/Rot/Size template
- Constraint template
- Image properties & linking template
- Modifier template

Such templates are first written in C, mostly because they have a 
specific complicated data handling that's not (yet) in the Python API. 
Gives us an easier migration path too.


- "Layout Engine"

Based on all the previous, the layout system will construct the button 
views and menus.
It will also take the available region dimension into account, to 
either stretch the buttons/collumns, or draw multiple collumns next to 
each other (to allow horizontal layouts).

The system will assign widget types to variables derived from their RNA 
definitions, and using labels and button names as stored in RNA or 
RNA-groups.

Scripts that define layouts should not define strings themselves, but 
use the names that come from RNA or were registered as Panel names. 
This will allow proper translation systems to work. Obviously, the 
scripts can always draw text if they like, but that's for customized 
UIs, not official releases.

The main UI script will be run at startup, it will scan all Panel 
definitions, register or verify them (if saved already in .blend) to 
the specific Editor/Region types.

Then, on each appropriate Blender WM notifier, these scripts get called 
per region, within Context, defining the Button Blocks.

Drawing happens only on "Button Block" level then, not calling the UI 
scripts.



-Ton-

------------------------------------------------------------------------
Ton Roosendaal  Blender Foundation   ton at blender.org    www.blender.org
Blender Institute BV  Entrepotdok 57A  1018AD Amsterdam The Netherlands



More information about the Bf-taskforce25 mailing list