From 8ace389fc4c5d0b5ea789f8a26d7c6ff84703916 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 30 Aug 2018 13:06:03 +1000 Subject: UI: move workspace panels to tool settings While this isn't the most logical place, there are very few workspace options and they don't need to be in such a prominent location. --- source/blender/editors/space_buttons/buttons_context.c | 3 +-- source/blender/editors/space_buttons/space_buttons.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/space_buttons') diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 41aadcc949f..9413978d5e6 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -514,7 +514,7 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma } /* No pinned root, use scene as initial root. */ else { - if (ELEM(mainb, BCONTEXT_WORKSPACE, BCONTEXT_TOOL)) { + if (mainb == BCONTEXT_TOOL) { RNA_id_pointer_create(&workspace->id, &path->ptr[0]); path->len++; } @@ -551,7 +551,6 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma found = buttons_context_path_world(path); break; case BCONTEXT_TOOL: - case BCONTEXT_WORKSPACE: found = buttons_context_path_workspace(path); break; case BCONTEXT_OBJECT: diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index fe10eee0536..5172d63911c 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -153,9 +153,6 @@ static void buttons_main_region_layout_properties(const bContext *C, SpaceButs * case BCONTEXT_WORLD: contexts[0] = "world"; break; - case BCONTEXT_WORKSPACE: - contexts[0] = "workspace"; - break; case BCONTEXT_OBJECT: contexts[0] = "object"; break; @@ -203,7 +200,7 @@ static void buttons_main_region_layout_tool(const bContext *C, ARegion *ar) const WorkSpace *workspace = CTX_wm_workspace(C); const int mode = CTX_data_mode_enum(C); - const char *contexts_base[4] = {NULL}; + const char *contexts_base[5] = {NULL}; contexts_base[0] = ".active_tool"; const char **contexts = &contexts_base[1]; @@ -284,6 +281,13 @@ static void buttons_main_region_layout_tool(const bContext *C, ARegion *ar) break; } + int i = 0; + while (contexts_base[i]) { + i++; + } + BLI_assert(i < ARRAY_SIZE(contexts_base)); + contexts_base[i] = ".workspace"; + const bool vertical = true; ED_region_panels_layout_ex(C, ar, contexts_base, -1, vertical); } -- cgit v1.2.3