Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-02-11 02:06:03 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-02-11 02:07:09 +0300
commit4f1e3875884506c017e03469658e9e7dadeeb500 (patch)
treeea3f5325a349ba3c749b7b5df6d0023329b070f4 /source/blender/makesrna/intern/rna_ui_api.c
parentd18993d4e457b195b2ebfc910dbaf14a023e1ec8 (diff)
UI: add optional tip callback to uiBut, and use it for per-item tooltips in UIList.
When defined, uiBut->tip_func is called when button's tip is generated. This allows for advanced, dynamic generation of tooltips. For now, only used by UIList, which can now optionaly use a given string property of each item for its tooltip. Thanks to Campbell for the reviews!
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index b5eeebae664..718a9dd7c6e 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -826,6 +826,8 @@ void RNA_api_ui_layout(StructRNA *srna)
parm = RNA_def_string(func, "active_propname", NULL, 0, "",
"Identifier of the integer property in active_data, index of the active item");
RNA_def_property_flag(parm, PROP_REQUIRED);
+ RNA_def_string(func, "item_dyntip_propname", NULL, 0, "",
+ "Identifier of a string property in items, to use as tooltip content");
RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Default and minimum number of rows to display", 0, INT_MAX);
RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Default maximum number of rows to display", 0, INT_MAX);
RNA_def_enum(func, "type", uilist_layout_type_items, UILST_LAYOUT_DEFAULT, "Type", "Type of layout to use");