Blender Git Loki

Git Commits -> Revision 61be5a0

April 14, 2020, 16:56 (GMT)
UI: Better split layout support for checkboxes

Makes these kinds of layouts possible:

Best test this in the `temp-checkbox-changes` branch which contains layout
tweaks all over to make good use of the changes here. These will be submitted
separately.
Patch on top of D7409.

Main changes:
* Add support for row and column headers (i.e.
`uiLayout.column(heading="Foo")`, `uiLayout.row(heading="Bar")). If the
first property added to this layout doesn't insert anything into the label
split column, the heading is inserted there. Otherwise, it's inserted as own
item.
* Add support for manually inserting decorators for an existing item
(`uiLayout.prop_decorator()`). That way layout creators can manually insert
this, which was the only way I saw to support these layouts:
* Autogenerated layouts for operator properties look bad if there are only
checkboxes (which only use half the region width). So before creating the
layout, we iterate over visible properties and disable split layout if all
are booleans. I think this is fine, if needed we could also add layout hints
to operators.
* `uiTemplateOperatorPropertyButs()` now handles macros itself, the caller
used to be responsible for this. Code that didn't handle these so far never
used macros I think, so this change should be visible.
* Remove manual property split layout from autogenerated operator properties
layout.
* Padding of checkboxes is tweaked to make their label visually more connected
to the checkboxes.
* Support split layout for menus (should work for `uiLayout.menu()`,
`.operator_menu_enum()`, `.prop_menu_enum()`, maybe more)
* Add `uiLayout.`

Maniphest Task: T65965

Reviewers: brecht pablovazquez billreynish

Commit Details:

Full Hash: 61be5a0c067161b3fd3486224b514c1c24b97abf
Parent Commit: 7b55740
Lines Changed: +594, -296

10 Modified Paths:

/source/blender/editors/include/UI_interface.h (+15, -5) (Diff)
/source/blender/editors/interface/interface.c (+21, -4) (Diff)
/source/blender/editors/interface/interface_anim.c (+43, -10) (Diff)
/source/blender/editors/interface/interface_intern.h (+5, -0) (Diff)
/source/blender/editors/interface/interface_layout.c (+232, -57) (Diff)
/source/blender/editors/interface/interface_templates.c (+238, -189) (Diff)
/source/blender/editors/interface/interface_utils.c (+4, -12) (Diff)
/source/blender/editors/interface/interface_widgets.c (+6, -6) (Diff)
/source/blender/makesrna/intern/rna_ui_api.c (+28, -2) (Diff)
/source/blender/windowmanager/intern/wm_operators.c (+2, -11) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021