UI: move workspace panels to tool settings
authorCampbell Barton <ideasman42@gmail.com>
Thu, 30 Aug 2018 03:06:03 +0000 (13:06 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 30 Aug 2018 03:06:03 +0000 (13:06 +1000)
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.

release/scripts/startup/bl_ui/properties_data_workspace.py
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesrna/intern/rna_space.c

index 0b2f556b8e5b64925b7ab7b4b7dcab4852d2d38c..f137c7401c206b0478ea1e73fcd04d6f3a5a3ad8 100644 (file)
@@ -28,7 +28,7 @@ from rna_prop_ui import PropertyPanel
 class WorkSpaceButtonsPanel:
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
-    bl_context = "workspace"
+    bl_context = ".workspace"
 
 
 class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel):
index 41aadcc949f5e40307433fc39e3ca4200647b466..9413978d5e65274bff5be6def12bc8592e74241a 100644 (file)
@@ -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:
index fe10eee053698ee94a83058ba51cd2658d81910c..5172d63911c90083b48dac8ed4de8a4af2b983b9 100644 (file)
@@ -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);
 }
index 5404f4160fd950d6b4d3fae776aa52f5c09ac8f1..f38669a757aeaeb732b9c8cfd508c01e135ce4c5 100644 (file)
@@ -197,8 +197,7 @@ typedef enum eSpaceButtons_Context {
        BCONTEXT_BONE_CONSTRAINT = 12,
        BCONTEXT_VIEW_LAYER = 13,
        BCONTEXT_TOOL = 14,
-       BCONTEXT_WORKSPACE = 15,
-       BCONTEXT_SHADERFX = 16,
+       BCONTEXT_SHADERFX = 15,
 
        /* always as last... */
        BCONTEXT_TOT
index d7563f13dc27f90cd3c827b98ce27959d2a9e933..7a831d08c88a3c603cb604d3a9ac50d86132d8c5 100644 (file)
@@ -288,7 +288,6 @@ static const EnumPropertyItem buttons_context_items[] = {
        {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
        {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle"},
        {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"},
-       {BCONTEXT_WORKSPACE, "WORKSPACE", ICON_SPLITSCREEN, "Workspace", "Workspace"},
        {BCONTEXT_SHADERFX, "SHADERFX", ICON_SOLO_ON, "Effects", "Object visual effects" },
        {0, NULL, 0, NULL, NULL}
 };
@@ -1319,10 +1318,6 @@ static const EnumPropertyItem *rna_SpaceProperties_context_itemf(
                RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_TOOL);
        }
 
-       if (sbuts->pathflag & (1 << BCONTEXT_WORKSPACE)) {
-               RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_WORKSPACE);
-       }
-
        if (totitem) {
                RNA_enum_item_add_separator(&item, &totitem);
        }