diff options
author | Matt Ebb <matt@mke3.net> | 2009-11-25 11:28:57 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-11-25 11:28:57 +0300 |
commit | ce4b63aa3f4f892703e6223a2546e067b446a98c (patch) | |
tree | 6279214f2f83d3d4f508c53c7ef686219a8a1f28 /source/blender/editors/animation/fmodifier_ui.c | |
parent | 7b6bc0225d1bcddbd3a8958c87b8be688b4f8699 (diff) |
Fix for [#20008] In the Graph Editor, clicking on the eye doesn't update the GUI
As part of this, fixed a typo in rna flags which was causing some strange behaviour with icons earlier. Reverted the workaround for this, too.
Diffstat (limited to 'source/blender/editors/animation/fmodifier_ui.c')
-rw-r--r-- | source/blender/editors/animation/fmodifier_ui.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index b1241bd274c..2448f1b8596 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -111,16 +111,6 @@ static void validate_fmodifier_cb (bContext *C, void *fcm_v, void *dummy) fmi->verify_data(fcm); } -/* callback to set the active modifier */ -static void activate_fmodifier_cb (bContext *C, void *fmods_v, void *fcm_v) -{ - ListBase *modifiers = (ListBase *)fmods_v; - FModifier *fcm= (FModifier *)fcm_v; - - /* call API function to set the active modifier for active modifier-stack */ - set_active_fmodifier(modifiers, fcm); -} - /* callback to remove the given modifier */ static void delete_fmodifier_cb (bContext *C, void *fmods_v, void *fcm_v) { @@ -636,6 +626,10 @@ void ANIM_uiTemplate_fmodifier_draw (const bContext *C, uiLayout *layout, ID *id uiBlock *block; uiBut *but; short width= 314; + PointerRNA ptr; + + /* init the RNA-pointer */ + RNA_pointer_create(id, &RNA_FModifierFunctionGenerator, fcm, &ptr); /* draw header */ { @@ -645,31 +639,33 @@ void ANIM_uiTemplate_fmodifier_draw (const bContext *C, uiLayout *layout, ID *id row= uiLayoutRow(box, 0); block= uiLayoutGetBlock(row); // err... - uiBlockSetEmboss(block, UI_EMBOSSN); - /* left-align -------------------------------------------- */ subrow= uiLayoutRow(row, 0); uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_LEFT); + uiBlockSetEmboss(block, UI_EMBOSSN); + /* expand */ - uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_EXPANDED, B_REDR, ICON_TRIA_RIGHT, 0, -1, UI_UNIT_X, UI_UNIT_Y, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is expanded."); + uiItemR(subrow, "", 0, &ptr, "expanded", UI_ITEM_R_ICON_ONLY); /* checkbox for 'active' status (for now) */ - but= uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_ACTIVE, B_REDR, ICON_RADIOBUT_OFF, 0, -1, UI_UNIT_X, UI_UNIT_Y, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is active one."); - uiButSetFunc(but, activate_fmodifier_cb, modifiers, fcm); + uiItemR(subrow, "", 0, &ptr, "active", UI_ITEM_R_ICON_ONLY); /* name */ if (fmi) - uiDefBut(block, LABEL, 1, fmi->name, 0, 0, 150, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "F-Curve Modifier Type. Click to make modifier active one."); + uiItemL(subrow, fmi->name, 0); else - uiDefBut(block, LABEL, 1, "<Unknown Modifier>", 0, 0, 150, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "F-Curve Modifier Type. Click to make modifier active one."); + uiItemL(subrow, "<Unknown Modifier>", 0); /* right-align ------------------------------------------- */ subrow= uiLayoutRow(row, 0); uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT); + /* 'mute' button */ - uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_MUTED, B_REDR, ICON_MUTE_IPO_OFF, 0, 0, UI_UNIT_X, UI_UNIT_Y, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is temporarily muted (not evaluated)."); + uiItemR(subrow, "", 0, &ptr, "muted", UI_ITEM_R_ICON_ONLY); + + uiBlockSetEmboss(block, UI_EMBOSSN); /* delete button */ but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier."); |