diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-28 17:26:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-28 17:31:07 +0300 |
commit | d937d06c02f62c11385c1c1f58d963fec03365d9 (patch) | |
tree | c9a7052205b4cbcc4c9219ed2e9838cc5414c56c /source/blender/editors/screen/area.c | |
parent | 80d1d9629e1d4dd12aca580e3844a24f5d160356 (diff) |
WorkSpace: UI filtering for add-ons
Allows for each workspace to have it's own add-ons on display.
Filtering for: Panels, Menus, Keymaps & Manipulators.
Automatically applies to add-ons at the moment.
Access from workspace, toggled off by default
once enabled, add-ons can be white-listed.
See D3076
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index f6a1e8913ff..ac577375a31 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -41,10 +41,10 @@ #include "BLI_utildefines.h" #include "BLI_linklist_stack.h" - #include "BKE_context.h" #include "BKE_global.h" #include "BKE_screen.h" +#include "BKE_workspace.h" #include "RNA_access.h" #include "RNA_types.h" @@ -1824,6 +1824,7 @@ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco) void ED_region_panels(const bContext *C, ARegion *ar, const char *context, int contextnr, const bool vertical) { + const WorkSpace *workspace = CTX_wm_workspace(C); ScrArea *sa = CTX_wm_area(C); uiStyle *style = UI_style_get_dpi(); uiBlock *block; @@ -1874,6 +1875,11 @@ void ED_region_panels(const bContext *C, ARegion *ar, const char *context, int c continue; } + /* If we're tagged, only use compatible. */ + if (pt->owner_id[0] && BKE_workspace_owner_id_check(workspace, pt->owner_id) == false) { + continue; + } + /* draw panel */ if (pt->draw && (!pt->poll || pt->poll(C, pt))) { BLI_SMALLSTACK_PUSH(pt_stack, pt); |