diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-29 15:50:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-29 16:35:13 +0300 |
commit | 17a4decfea7593d11f92a58b591a40d5e95dd6cb (patch) | |
tree | d9b1626e735eaf0dd97bc33bf30bd76b045e8ae4 /source | |
parent | 1c4fa32db6f8c8df29a2226c6915f88a9b29c4bd (diff) |
UI: top-bar reorganization
This hides the top-bar by default for everything
besides paint/sculpt workspaces.
- Use the top-bar mainly for active tool settings &
popovers panel options.
(transform / snap settings are an exception for this convention).
- Only show the top-bar (by default)
in paint work-spaces (sculpt / texture-paint / grease-pencil).
- Add an active-tool panel to the sidebar.
- Split 3D view tabs into (Item / Tool / View).
D4721 with minor changes.
Further work is needed for the top-bar and image-editor.
Diffstat (limited to 'source')
5 files changed, 34 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index ae8bf8010cc..f9f87731197 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -3245,6 +3245,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); BLI_insertlinkbefore(regionbase, ar_header, ar); + /* Hide by default, enable for painting workspaces (startup only). */ + ar->flag |= RGN_FLAG_HIDDEN | RGN_FLAG_HIDDEN_BY_USER; } if (ar != NULL) { SET_FLAG_FROM_TEST(ar->flag, ar->flag & RGN_FLAG_HIDDEN_BY_USER, RGN_FLAG_HIDDEN); diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index b5b86224644..7674c7cadcd 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -293,6 +293,34 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) } } + /* Show toopbar for sculpt/paint modes. */ + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { + bool show_tool_header = false; + if (app_template == NULL) { + if (STR_ELEM(screen->id.name + 2, "Sculpting", "Texture Paint")) { + show_tool_header = true; + } + } + else if (STREQ(app_template, "2D_Animation")) { + if (STR_ELEM(screen->id.name + 2, "Sculpting", "Texture Paint")) { + show_tool_header = true; + } + } + + if (show_tool_header) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; + for (ARegion *ar = regionbase->first; ar; ar = ar->next) { + if (ar->regiontype == RGN_TYPE_TOOL_HEADER) { + ar->flag &= ~(RGN_FLAG_HIDDEN | RGN_FLAG_HIDDEN_BY_USER); + } + } + } + } + } + } + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine)); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index ebecd474621..20bcf19d7f2 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -140,6 +140,7 @@ static SpaceLink *image_new(const ScrArea *UNUSED(area), const Scene *UNUSED(sce BLI_addtail(&simage->regionbase, ar); ar->regiontype = RGN_TYPE_TOOL_HEADER; ar->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP; + ar->flag = RGN_FLAG_HIDDEN | RGN_FLAG_HIDDEN_BY_USER; /* header */ ar = MEM_callocN(sizeof(ARegion), "header for image"); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 456a012020f..9ee7bb3066d 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -303,6 +303,7 @@ static SpaceLink *view3d_new(const ScrArea *UNUSED(sa), const Scene *scene) BLI_addtail(&v3d->regionbase, ar); ar->regiontype = RGN_TYPE_TOOL_HEADER; ar->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP; + ar->flag = RGN_FLAG_HIDDEN | RGN_FLAG_HIDDEN_BY_USER; /* header */ ar = MEM_callocN(sizeof(ARegion), "header for view3d"); diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 52feff4b65a..1e1cb50d8ae 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1605,7 +1605,7 @@ void view3d_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel object"); strcpy(pt->idname, "VIEW3D_PT_transform"); strcpy(pt->label, N_("Transform")); /* XXX C panels unavailable through RNA bpy.types! */ - strcpy(pt->category, "View"); + strcpy(pt->category, "Item"); strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = view3d_panel_transform; pt->poll = view3d_panel_transform_poll; @@ -1614,7 +1614,7 @@ void view3d_buttons_register(ARegionType *art) pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel vgroup"); strcpy(pt->idname, "VIEW3D_PT_vgroup"); strcpy(pt->label, N_("Vertex Weights")); /* XXX C panels unavailable through RNA bpy.types! */ - strcpy(pt->category, "View"); + strcpy(pt->category, "Item"); strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw = view3d_panel_vgroup; pt->poll = view3d_panel_vgroup_poll; |