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:
authorCampbell Barton <ideasman42@gmail.com>2016-03-15 13:12:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-03-15 13:13:41 +0300
commitb7deea029a2ad80757ab6859c88990d036c5729c (patch)
treef9d91ee3d82d938fc918adce5403c0c7c64c3521 /source/blender/makesrna/intern/rna_access.c
parent647a4ea2f7a057159aae29d875e20db2809b563b (diff)
Fix T47780: Icons don't update in floating panels
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 6d48c69e9d8..97c71715349 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -1521,6 +1521,51 @@ bool RNA_property_enum_name_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA
return result;
}
+bool RNA_property_enum_item_from_value(
+ bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value,
+ EnumPropertyItem *r_item)
+{
+ EnumPropertyItem *item = NULL;
+ bool free;
+
+ RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
+ if (item) {
+ const int i = RNA_enum_from_value(item, value);
+ bool result;
+
+ if (i != -1) {
+ *r_item = item[i];
+ result = true;
+ }
+ else {
+ result = false;
+ }
+
+ if (free)
+ MEM_freeN(item);
+
+ return result;
+ }
+ return false;
+}
+
+bool RNA_property_enum_item_from_value_gettexted(
+ bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value,
+ EnumPropertyItem *r_item)
+{
+ bool result;
+
+ result = RNA_property_enum_item_from_value(C, ptr, prop, value, r_item);
+
+ if (!(prop->flag & PROP_ENUM_NO_TRANSLATE)) {
+ if (BLT_translate_iface()) {
+ r_item->name = BLT_pgettext(prop->translation_context, r_item->name);
+ }
+ }
+
+ return result;
+}
+
int RNA_property_enum_bitflag_identifiers(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value,
const char **identifier)
{