Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_templates.c
| Show First 20 Lines • Show All 2,721 Lines • ▼ Show 20 Lines | static void draw_constraint_header(uiLayout *layout, Object *ob, bConstraint *con) | ||||
| /* unless button has own callback, it adds this callback to button */ | /* unless button has own callback, it adds this callback to button */ | ||||
| uiBlock *block = uiLayoutGetBlock(layout); | uiBlock *block = uiLayoutGetBlock(layout); | ||||
| UI_block_func_set(block, constraint_active_func, ob, con); | UI_block_func_set(block, constraint_active_func, ob, con); | ||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| RNA_pointer_create(&ob->id, &RNA_Constraint, con, &ptr); | RNA_pointer_create(&ob->id, &RNA_Constraint, con, &ptr); | ||||
| if (block->panel) { | |||||
| UI_panel_context_pointer_set(block->panel, "constraint", &ptr); | |||||
| } | |||||
| else { | |||||
| uiLayoutSetContextPointer(layout, "constraint", &ptr); | uiLayoutSetContextPointer(layout, "constraint", &ptr); | ||||
| } | |||||
| /* Constraint type icon. */ | /* Constraint type icon. */ | ||||
| uiLayout *sub = uiLayoutRow(layout, false); | uiLayout *sub = uiLayoutRow(layout, false); | ||||
| uiLayoutSetEmboss(sub, false); | uiLayoutSetEmboss(sub, false); | ||||
| uiLayoutSetRedAlert(sub, (con->flag & CONSTRAINT_DISABLE)); | uiLayoutSetRedAlert(sub, (con->flag & CONSTRAINT_DISABLE)); | ||||
| uiItemL(sub, "", RNA_struct_ui_icon(ptr.type)); | uiItemL(sub, "", RNA_struct_ui_icon(ptr.type)); | ||||
| UI_block_emboss_set(block, UI_EMBOSS); | UI_block_emboss_set(block, UI_EMBOSS); | ||||
| ▲ Show 20 Lines • Show All 3,866 Lines • Show Last 20 Lines | |||||