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. --- source/blender/editors/space_graph/graph_buttons.c | 24 ---------------------- 1 file changed, 24 deletions(-) (limited to 'source/blender/editors/space_graph/graph_buttons.c') diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index ac77095cbe2..8742f5d408c 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -1405,27 +1405,3 @@ void graph_buttons_register(ARegionType *art) pt->draw = graph_panel_view; BLI_addtail(&art->paneltypes, pt); } - -static int graph_properties_toggle_exec(bContext *C, wmOperator *UNUSED(op)) -{ - ScrArea *sa = CTX_wm_area(C); - ARegion *ar = graph_has_buttons_region(sa); - - if (ar) - ED_region_toggle_hidden(C, ar); - - return OPERATOR_FINISHED; -} - -void GRAPH_OT_properties(wmOperatorType *ot) -{ - ot->name = "Toggle Sidebar"; - ot->idname = "GRAPH_OT_properties"; - ot->description = "Toggle the properties region visibility"; - - ot->exec = graph_properties_toggle_exec; - ot->poll = ED_operator_graphedit_active; - - /* flags */ - ot->flag = 0; -} -- cgit v1.2.3