diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-10-19 13:50:02 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-10-19 13:50:02 +0400 |
commit | 73d0c673e8df02dc14457215eb46bd5e1468450f (patch) | |
tree | 46af1f144266c8f97eff7c21821c8dc18b5788c6 /source | |
parent | 0445ff1ae9ce619efa1eb065eecbc03e45e90d62 (diff) |
Fixed Layout-Engine bug that was causing checkbox menu entries to draw with the wrong icon when enabled.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 233d3b214ae..51458f75ed9 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -892,10 +892,13 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper 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); |