diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-12-28 13:20:16 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-12-28 13:20:16 +0400 |
commit | 7504cf34b470bec3b3fc7239d655738a09ed7624 (patch) | |
tree | b811d07dc2b708163b2944bb7b3c4cc99aa588ed /release/scripts/startup/bl_ui/properties_data_armature.py | |
parent | 7730ddb3d6211a9c03e4b2eebedefcfb6f709891 (diff) |
This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_armature.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_armature.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index 845beb0f862..1643210704e 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -124,7 +124,7 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel): rows = 2 if group: rows = 5 - row.template_list(pose, "bone_groups", pose.bone_groups, "active_index", rows=rows) + row.template_list("UI_UL_list", "", pose, "bone_groups", pose.bone_groups, "active_index", rows=rows) col = row.column(align=True) col.active = (ob.proxy is None) @@ -184,7 +184,7 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel): if poselib: # list of poses in pose library row = layout.row() - row.template_list(poselib, "pose_markers", poselib.pose_markers, "active_index", rows=5) + row.template_list("UI_UL_list", "", poselib, "pose_markers", poselib.pose_markers, "active_index", rows=5) # column of operators for active pose # - goes beside list |