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:
authorJoshua Leung <aligorith@gmail.com>2009-10-28 13:16:49 +0300
committerJoshua Leung <aligorith@gmail.com>2009-10-28 13:16:49 +0300
commite694e307211a084c3f01b8554b9c9b2abaddb014 (patch)
treea281755a5e222f9ffb33af719532ba7271e95f61 /source/blender/editors/interface/interface_layout.c
parent8510723cf4577e916a26bb2ee5b4fd545fac505e (diff)
UI Icon Toggles Fix:
Boolean settings now use TOG instead of ICONTOG when they have icons, since ICONTOG was causing too much trouble with icons changing when they shouldn't be. Perhaps in future there should be some flag for specifying from RNA/UI-Layouts which one you want, but for now, this will do. Reverting r23936 since that fix depended on ICONTOG behaviour.
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r--source/blender/editors/interface/interface_layout.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 41a0ad7d4b0..5c7c1b130e4 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -893,13 +893,10 @@ 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) {
- /* 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... */
+ 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;
}
slider= (flag & UI_ITEM_R_SLIDER);