From 6aef124e7d2869a692dd564a4515f2304924da33 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 18 Apr 2019 12:16:03 +0200 Subject: UI: move region toggling to properties Each space had separate operators, duplicating logic. Use RNA properties instead so adding the ability to toggle other region types (floating redo region for eg) doesn't need to have an extra operator per space type. It's also nicer to show a check-box for something which can be toggled. --- .../blender/editors/space_action/action_buttons.c | 24 ---------------------- .../blender/editors/space_action/action_intern.h | 1 - source/blender/editors/space_action/action_ops.c | 3 --- 3 files changed, 28 deletions(-) (limited to 'source/blender/editors/space_action') diff --git a/source/blender/editors/space_action/action_buttons.c b/source/blender/editors/space_action/action_buttons.c index a30d5f34ed0..c9c20adcab4 100644 --- a/source/blender/editors/space_action/action_buttons.c +++ b/source/blender/editors/space_action/action_buttons.c @@ -92,27 +92,3 @@ void action_buttons_register(ARegionType *UNUSED(art)) BLI_addtail(&art->paneltypes, pt); #endif } - -static int action_properties_toggle_exec(bContext *C, wmOperator *UNUSED(op)) -{ - ScrArea *sa = CTX_wm_area(C); - ARegion *ar = action_has_buttons_region(sa); - - if (ar) - ED_region_toggle_hidden(C, ar); - - return OPERATOR_FINISHED; -} - -void ACTION_OT_properties(wmOperatorType *ot) -{ - ot->name = "Toggle Sidebar"; - ot->idname = "ACTION_OT_properties"; - ot->description = "Toggle the properties region visibility"; - - ot->exec = action_properties_toggle_exec; - ot->poll = ED_operator_action_active; - - /* flags */ - ot->flag = 0; -} diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h index 5d86cf6faec..bf2880dea36 100644 --- a/source/blender/editors/space_action/action_intern.h +++ b/source/blender/editors/space_action/action_intern.h @@ -43,7 +43,6 @@ struct wmOperatorType; struct ARegion *action_has_buttons_region(struct ScrArea *sa); void action_buttons_register(struct ARegionType *art); -void ACTION_OT_properties(struct wmOperatorType *ot); /* ***************************************** */ /* action_draw.c */ diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index d5ddf974284..4419a4d068e 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -43,9 +43,6 @@ void action_operatortypes(void) { - /* view */ - WM_operatortype_append(ACTION_OT_properties); - /* keyframes */ /* selection */ WM_operatortype_append(ACTION_OT_clickselect); -- cgit v1.2.3