Commit: dc87648970f56e9c1aa01e39b2414f97f2b99ed5
Author: Clément Foucault
Date:   Mon Jul 2 19:11:36 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBdc87648970f56e9c1aa01e39b2414f97f2b99ed5

UI: Fix Properties with consecutive icons enabled in dropdown menus

It was using ICON_UNLOCKED when the property was true.

This affected the use_lock_interface properties now displayed in the Render
menu.

===================================================================

M       source/blender/editors/interface/interface_layout.c

===================================================================

diff --git a/source/blender/editors/interface/interface_layout.c 
b/source/blender/editors/interface/interface_layout.c
index 4ff19d66bac..9b9199538d6 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1554,13 +1554,24 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, 
PropertyRNA *prop, int index
            /* use checkboxes only as a fallback in pie-menu's, when no icon is 
defined */
            ((layout->root->type == UI_LAYOUT_PIEMENU) && (icon == ICON_NONE)))
        {
+               int prop_flag = RNA_property_flag(prop);
                if (type == PROP_BOOLEAN && ((is_array == false) || (index != 
RNA_NO_INDEX))) {
-                       if (is_array) icon = 
(RNA_property_boolean_get_index(ptr, prop, index)) ? ICON_CHECKBOX_HLT : 
ICON_CHECKBOX_DEHLT;
-                       else icon = (RNA_property_boolean_get(ptr, prop)) ? 
ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT;
+                       if (prop_flag & PROP_ICONS_CONSECUTIVE) {
+                               icon = ICON_CHECKBOX_DEHLT; /* but->iconadd 
will set to correct icon */
+                       }
+                       else if (is_array) {
+                               icon = (RNA_property_boolean_get_index(ptr, 
prop, index)) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT;
+                       }
+                       else {
+                               icon = (RNA_property_boolean_get(ptr, prop)) ? 
ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT;
+                       }
                }
                else if (type == PROP_ENUM && index == RNA_ENUM_VALUE) {
                        int enum_value = RNA_property_enum_get(ptr, prop);
-                       if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
+                       if (prop_flag & PROP_ICONS_CONSECUTIVE) {
+                               icon = ICON_CHECKBOX_DEHLT; /* but->iconadd 
will set to correct icon */
+                       }
+                       else if (prop_flag & PROP_ENUM_FLAG) {
                                icon = (enum_value & value) ? ICON_CHECKBOX_HLT 
: ICON_CHECKBOX_DEHLT;
                        }
                        else {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to