diff options
Diffstat (limited to 'source/blender/editors/space_clip/clip_toolbar.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_toolbar.c | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/source/blender/editors/space_clip/clip_toolbar.c b/source/blender/editors/space_clip/clip_toolbar.c index acb05e7d542..d54a6da9a3c 100644 --- a/source/blender/editors/space_clip/clip_toolbar.c +++ b/source/blender/editors/space_clip/clip_toolbar.c @@ -78,95 +78,3 @@ ARegion *ED_clip_has_properties_region(ScrArea *sa) return arnew; } - -static bool properties_poll(bContext *C) -{ - return (CTX_wm_space_clip(C) != NULL); -} - -static int properties_exec(bContext *C, wmOperator *UNUSED(op)) -{ - ScrArea *sa = CTX_wm_area(C); - ARegion *ar = ED_clip_has_properties_region(sa); - - if (ar && ar->alignment != RGN_ALIGN_NONE) - ED_region_toggle_hidden(C, ar); - - return OPERATOR_FINISHED; -} - -void CLIP_OT_properties(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Toggle Sidebar"; - ot->description = "Toggle the properties region visibility"; - ot->idname = "CLIP_OT_properties"; - - /* api callbacks */ - ot->exec = properties_exec; - ot->poll = properties_poll; -} - -/************************** tools ******************************/ - -static ARegion *clip_has_tools_region(ScrArea *sa) -{ - ARegion *ar, *artool = NULL, *arhead; - - for (ar = sa->regionbase.first; ar; ar = ar->next) { - if (ar->regiontype == RGN_TYPE_TOOLS) - artool = ar; - } - - /* tool region hide/unhide also hides props */ - if (artool) { - return artool; - } - - if (artool == NULL) { - /* add subdiv level; after header */ - arhead = BKE_area_find_region_type(sa, RGN_TYPE_HEADER); - - /* is error! */ - if (arhead == NULL) - return NULL; - - artool = MEM_callocN(sizeof(ARegion), "clip tools region"); - - BLI_insertlinkafter(&sa->regionbase, arhead, artool); - artool->regiontype = RGN_TYPE_TOOLS; - artool->alignment = RGN_ALIGN_LEFT; - - artool->flag = RGN_FLAG_HIDDEN; - } - - return artool; -} - -static bool tools_poll(bContext *C) -{ - return (CTX_wm_space_clip(C) != NULL); -} - -static int tools_exec(bContext *C, wmOperator *UNUSED(op)) -{ - ScrArea *sa = CTX_wm_area(C); - ARegion *ar = clip_has_tools_region(sa); - - if (ar && ar->alignment != RGN_ALIGN_NONE) - ED_region_toggle_hidden(C, ar); - - return OPERATOR_FINISHED; -} - -void CLIP_OT_tools(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Toggle Toolbar"; - ot->description = "Toggle clip tools panel"; - ot->idname = "CLIP_OT_tools"; - - /* api callbacks */ - ot->exec = tools_exec; - ot->poll = tools_poll; -} |