Blender Git Commit Log

Git Commits -> Revision 6640bcc

Revision 6640bcc by Campbell Barton (master)
May 21, 2019, 05:06 (GMT)
UI: support drawing booleans with icons as check-boxes

Previously, if a boolean happened to use an icon there was no way
to make it display as a check-box from Python scripts.

The previous logic meant we ended up having to edit the RNA.
Since booleans with icons don't work well with the split-property layout
(now used for most of the interface).
Icons were being removed from RNA then added back using awkward Python
ternary expressions in the interface scripts.

The toggle argument now has an unset state (-1).

- toggle=True: no checkbox (emboss).
- toggle=False: always use a checkbox (no icon).
- toggle=(unset/-1): depends on the icon status, default as before.

Since toggle=False was default, this isn't used in existing UI logic.

Commit Details:

Full Hash: 6640bcca742210fa3dc9c8a0675ebf71a9e9e7f6
Parent Commit: 87fda5b
Lines Changed: +110, -50

5 Modified Paths:

/source/blender/editors/include/UI_interface.h (+21, -8) (Diff)
/source/blender/editors/interface/interface.c (+10, -0) (Diff)
/source/blender/editors/interface/interface_intern.h (+1, -0) (Diff)
/source/blender/editors/interface/interface_layout.c (+60, -39) (Diff)
/source/blender/makesrna/intern/rna_ui_api.c (+18, -3) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021