diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-18 13:16:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-18 13:44:17 +0300 |
commit | 6aef124e7d2869a692dd564a4515f2304924da33 (patch) | |
tree | 9ed5d09fd9a94761ce08db54abe2b5082a00029f /source/blender/editors/space_node/node_toolbar.c | |
parent | d55a9cac2c0aa6a7d130a256cac7c04e52cdee4a (diff) |
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.
Diffstat (limited to 'source/blender/editors/space_node/node_toolbar.c')
-rw-r--r-- | source/blender/editors/space_node/node_toolbar.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/source/blender/editors/space_node/node_toolbar.c b/source/blender/editors/space_node/node_toolbar.c index bc7119fa4ab..7afd3fef4db 100644 --- a/source/blender/editors/space_node/node_toolbar.c +++ b/source/blender/editors/space_node/node_toolbar.c @@ -40,37 +40,3 @@ void node_toolbar_register(ARegionType *UNUSED(art)) { } - -/* ********** operator to open/close toolshelf region */ - -static int node_toolbar_toggle_exec(bContext *C, wmOperator *UNUSED(op)) -{ - ScrArea *sa = CTX_wm_area(C); - ARegion *ar = node_has_tools_region(sa); - - if (ar) { - ED_region_toggle_hidden(C, ar); - } - - return OPERATOR_FINISHED; -} - -/* non-standard poll operator which doesn't care if there are any nodes */ -static bool node_toolbar_poll(bContext *C) -{ - ScrArea *sa = CTX_wm_area(C); - return (sa && (sa->spacetype == SPACE_NODE)); -} - -void NODE_OT_toolbar(wmOperatorType *ot) -{ - ot->name = "Tool Shelf"; - ot->description = "Toggles tool shelf display"; - ot->idname = "NODE_OT_toolbar"; - - ot->exec = node_toolbar_toggle_exec; - ot->poll = node_toolbar_poll; - - /* flags */ - ot->flag = 0; -} |