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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-10-29 18:58:34 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-10-29 21:04:07 +0300
commitb5667c2ca7f7cc33903b7f664dfbd3bccd8cdd22 (patch)
tree189f7a60d860c563c6abf37899aae3fcf85c46cf /source/blender/makesrna
parent4c7f08e5ebc107e13501a5b1e82a44edeaf7b7c3 (diff)
UI: allow off/on icons to be in reverse order.
The same icons are reused for "hide" and "show" properties, which need to be in reverse order compared to each other.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_define.h2
-rw-r--r--source/blender/makesrna/RNA_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_define.c6
3 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
index 551805f6a80..e14dcbea09e 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -175,7 +175,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value);
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description);
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision);
-void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, bool consecutive);
+void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive);
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *updatefunc);
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable);
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index 0e7c3956d7b..72e1c05de3c 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -184,6 +184,7 @@ typedef enum PropertyFlag {
/* icon */
PROP_ICONS_CONSECUTIVE = (1 << 12),
+ PROP_ICONS_REVERSE = (1 << 8),
/* hidden in the user interface */
PROP_HIDDEN = (1 << 19),
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index c3c7367283e..42db80c83c0 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -1426,11 +1426,13 @@ void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *d
prop->description = description;
}
-void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, bool consecutive)
+void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
{
prop->icon = icon;
- if (consecutive)
+ if (consecutive != 0)
prop->flag |= PROP_ICONS_CONSECUTIVE;
+ if (consecutive < 0)
+ prop->flag |= PROP_ICONS_REVERSE;
}
/**