UI: show workspace panel last & use a parent panel

This commit is contained in:
Campbell Barton 2018-08-30 13:30:16 +10:00
parent 8ace389fc4
commit e9c2477a84
2 changed files with 15 additions and 2 deletions

@ -43,7 +43,6 @@ _modules = [
"properties_data_shaderfx",
"properties_data_lightprobe",
"properties_data_speaker",
"properties_data_workspace",
"properties_mask_common",
"properties_material",
"properties_material_gpencil",
@ -91,6 +90,9 @@ _modules = [
"space_userpref",
"space_view3d",
"space_view3d_toolbar",
# XXX, keep last so panels show after all other tool options.
"properties_data_workspace",
]
import bpy

@ -31,9 +31,17 @@ class WorkSpaceButtonsPanel:
bl_context = ".workspace"
class WORKSPACE_PT_main(WorkSpaceButtonsPanel, Panel):
bl_label = "Workspace"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
pass
class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel):
bl_label = "Workspace Add-ons"
bl_options = {'DEFAULT_CLOSED'}
bl_parent_id = "WORKSPACE_PT_main"
def draw_header(self, context):
workspace = context.workspace
@ -86,11 +94,14 @@ class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel):
class WORKSPACE_PT_custom_props(WorkSpaceButtonsPanel, PropertyPanel, Panel):
bl_parent_id = "WORKSPACE_PT_main"
_context_path = "workspace"
_property_type = bpy.types.WorkSpace
classes = (
WORKSPACE_PT_main,
WORKSPACE_PT_owner_ids,
WORKSPACE_PT_custom_props,
)