Revision: 23936
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23936
Author:   aligorith
Date:     2009-10-19 11:50:02 +0200 (Mon, 19 Oct 2009)

Log Message:
-----------
Fixed Layout-Engine bug that was causing checkbox menu entries to draw with the 
wrong icon when enabled.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_layout.c

Modified: trunk/blender/source/blender/editors/interface/interface_layout.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_layout.c   
2009-10-19 08:01:30 UTC (rev 23935)
+++ trunk/blender/source/blender/editors/interface/interface_layout.c   
2009-10-19 09:50:02 UTC (rev 23936)
@@ -892,10 +892,13 @@
                name= ui_item_name_add_colon(name, namestr);
 
        if(layout->root->type == UI_LAYOUT_MENU) {
-               if(type == PROP_BOOLEAN)
-                       icon= (RNA_property_boolean_get(ptr, prop))? 
ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT;
-               else if(type == PROP_ENUM && index == RNA_ENUM_VALUE)
-                       icon= (RNA_property_enum_get(ptr, prop) == value)? 
ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT; 
+               /* whether the property is actually enabled doesn't matter, 
+                * since the widget code for drawing toggles takes care of the 
+                * rest (i.e. given the deactivated icon, it finds the active 
one
+                * based on the state of the setting)
+                */
+               if ( (type == PROP_BOOLEAN) || (type==PROP_ENUM && 
index==RNA_ENUM_VALUE) )
+                       icon= ICON_CHECKBOX_DEHLT; /* ICON_CHECKBOX_HLT when 
on... */
        }
 
        slider= (flag & UI_ITEM_R_SLIDER);


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to