Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_image/image_buttons.c
| Show First 20 Lines • Show All 942 Lines • ▼ Show 20 Lines | if (ima && iuser) { | ||||
| uiblock_layer_pass_buttons(layout, rr, iuser, 160 * dpi_fac, (ima->type == IMA_TYPE_R_RESULT) ? &ima->render_slot : NULL); | uiblock_layer_pass_buttons(layout, rr, iuser, 160 * dpi_fac, (ima->type == IMA_TYPE_R_RESULT) ? &ima->render_slot : NULL); | ||||
| BKE_image_release_renderresult(scene, ima); | BKE_image_release_renderresult(scene, ima); | ||||
| } | } | ||||
| } | } | ||||
| void image_buttons_register(ARegionType *art) | void image_buttons_register(ARegionType *art) | ||||
| { | { | ||||
| PanelType *pt; | PanelType *pt; | ||||
| const char *category = "Grease Pencil"; | |||||
| pt = MEM_callocN(sizeof(PanelType), "spacetype image panel gpencil"); | pt = MEM_callocN(sizeof(PanelType), "spacetype image panel gpencil"); | ||||
| strcpy(pt->idname, "IMAGE_PT_gpencil"); | strcpy(pt->idname, "IMAGE_PT_gpencil"); | ||||
| strcpy(pt->label, N_("Grease Pencil")); | strcpy(pt->label, N_("Grease Pencil")); | ||||
| strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); | strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); | ||||
| pt->draw_header = gpencil_panel_standard_header; | pt->draw_header = gpencil_panel_standard_header; | ||||
| pt->draw = gpencil_panel_standard; | pt->draw = gpencil_panel_standard; | ||||
| BLI_strncpy(pt->category, category, BLI_strlen_utf8(category)); | |||||
| BLI_addtail(&art->paneltypes, pt); | BLI_addtail(&art->paneltypes, pt); | ||||
| } | } | ||||
| static int image_properties_toggle_exec(bContext *C, wmOperator *UNUSED(op)) | static int image_properties_toggle_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| ScrArea *sa = CTX_wm_area(C); | ScrArea *sa = CTX_wm_area(C); | ||||
| ARegion *ar = image_has_buttons_region(sa); | ARegion *ar = image_has_buttons_region(sa); | ||||
| Show All 14 Lines | void IMAGE_OT_properties(wmOperatorType *ot) | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = 0; | ot->flag = 0; | ||||
| } | } | ||||
| static int image_scopes_toggle_exec(bContext *C, wmOperator *UNUSED(op)) | static int image_scopes_toggle_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| ScrArea *sa = CTX_wm_area(C); | ScrArea *sa = CTX_wm_area(C); | ||||
| ARegion *ar = image_has_scope_region(sa); | ARegion *ar = image_has_tools_region(sa); | ||||
| if (ar) | if (ar) | ||||
| ED_region_toggle_hidden(C, ar); | ED_region_toggle_hidden(C, ar); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void IMAGE_OT_scopes(wmOperatorType *ot) | void IMAGE_OT_toolshelf(wmOperatorType *ot) | ||||
| { | { | ||||
| ot->name = "Scopes"; | ot->name = "Tool Shelf"; | ||||
| ot->idname = "IMAGE_OT_scopes"; | ot->idname = "IMAGE_OT_toolshelf"; | ||||
| ot->description = "Toggle display scopes panel"; | ot->description = "Toggles tool shelf display"; | ||||
| ot->exec = image_scopes_toggle_exec; | ot->exec = image_scopes_toggle_exec; | ||||
| ot->poll = ED_operator_image_active; | ot->poll = ED_operator_image_active; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = 0; | ot->flag = 0; | ||||
| } | } | ||||