diff --git a/scripts/startup/bl_ui/space_userpref.py b/scripts/startup/bl_ui/space_userpref.py index 7151f289fc7..dec7ca55f0e 100644 --- a/scripts/startup/bl_ui/space_userpref.py +++ b/scripts/startup/bl_ui/space_userpref.py @@ -87,8 +87,12 @@ class USERPREF_MT_editor_menus(Menu): class USERPREF_MT_view(Menu): bl_label = "View" - def draw(self, _context): + def draw(self, context): layout = self.layout + view = context.space_data + + layout.prop(view, "show_region_ui") + layout.separator() layout.menu("INFO_MT_area") diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index c6f1c2ad189..ecfbafdd943 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -27,7 +27,7 @@ /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 83 +#define BLENDER_FILE_SUBVERSION 84 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and cancel loading the file, showing a warning to diff --git a/source/blender/blenloader/intern/versioning_500.cc b/source/blender/blenloader/intern/versioning_500.cc index 71b9a378cca..4f7f66c59af 100644 --- a/source/blender/blenloader/intern/versioning_500.cc +++ b/source/blender/blenloader/intern/versioning_500.cc @@ -3339,6 +3339,26 @@ void blo_do_versions_500(FileData *fd, Library * /*lib*/, Main *bmain) FOREACH_NODETREE_END; } + if (!MAIN_VERSION_FILE_ATLEAST(bmain, 500, 84)) { + /* Add sidebar to the preferences editor. */ + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + if (sl->spacetype == SPACE_USERPREF) { + ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : + &sl->regionbase; + ARegion *new_sidebar = do_versions_add_region_if_not_found( + regionbase, RGN_TYPE_UI, "sidebar for preferences", RGN_TYPE_HEADER); + if (new_sidebar != nullptr) { + new_sidebar->alignment = RGN_ALIGN_LEFT; + new_sidebar->flag &= ~RGN_FLAG_HIDDEN; + } + } + } + } + } + } + /** * Always bump subversion in BKE_blender_version.h when adding versioning * code here, and wrap it inside a MAIN_VERSION_FILE_ATLEAST check. diff --git a/source/blender/editors/space_userpref/space_userpref.cc b/source/blender/editors/space_userpref/space_userpref.cc index fbb5557898c..730be82be3d 100644 --- a/source/blender/editors/space_userpref/space_userpref.cc +++ b/source/blender/editors/space_userpref/space_userpref.cc @@ -53,6 +53,7 @@ static SpaceLink *userpref_create(const ScrArea *area, const Scene * /*scene*/) BLI_addtail(&spref->regionbase, region); region->regiontype = RGN_TYPE_UI; region->alignment = RGN_ALIGN_LEFT; + region->flag &= ~RGN_FLAG_HIDDEN; /* Use smaller size when opened in area like properties editor. */ if (area->winx && area->winx < 3.0f * UI_NAVIGATION_REGION_WIDTH * UI_SCALE_FAC) { diff --git a/source/blender/makesrna/intern/rna_space.cc b/source/blender/makesrna/intern/rna_space.cc index 06944f9c48d..03222eca8bd 100644 --- a/source/blender/makesrna/intern/rna_space.cc +++ b/source/blender/makesrna/intern/rna_space.cc @@ -7708,6 +7708,8 @@ static void rna_def_space_userpref(BlenderRNA *brna) RNA_def_struct_sdna(srna, "SpaceUserPref"); RNA_def_struct_ui_text(srna, "Space Preferences", "Blender preferences space data"); + rna_def_space_generic_show_region_toggles(srna, (1 << RGN_TYPE_UI)); + prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, nullptr, "filter_type"); RNA_def_property_enum_items(prop, filter_type_items);