[Bf-blender-cvs] [d9cf9c659ce] filebrowser_redesign: Use full area width for filepath region

Julian Eisel noreply at git.blender.org
Fri Jul 26 01:26:04 CEST 2019


Commit: d9cf9c659ce4e0c072b63637d208ce65be998273
Author: Julian Eisel
Date:   Thu Jul 25 03:11:58 2019 +0200
Branches: filebrowser_redesign
https://developer.blender.org/rBd9cf9c659ce4e0c072b63637d208ce65be998273

Use full area width for filepath region

Also adjusts size for old files.

===================================================================

M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/editors/space_file/space_file.c

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index cb2b64957f0..ffe33253135 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3535,5 +3535,22 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
 
   {
     /* Versioning code until next subversion bump goes here. */
+    for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+      for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+        for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+          if (sl->spacetype == SPACE_FILE) {
+            ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
+            ARegion *ar_ui = do_versions_find_region(regionbase, RGN_TYPE_UI);
+            ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER);
+
+            if (ar_ui && ar_header) {
+              /* Reinsert UI region so that it spawns entire area width */
+              BLI_remlink(regionbase, ar_ui);
+              BLI_insertlinkafter(regionbase, ar_header, ar_ui);
+            }
+          }
+        }
+      }
+    }
   }
 }
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index f7d83570b90..1f90d09b697 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -72,6 +72,13 @@ static SpaceLink *file_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scen
   /* Ignore user preference "USER_HEADER_BOTTOM" here (always show top for new types). */
   ar->alignment = RGN_ALIGN_TOP;
 
+  /* ui list region */
+  ar = MEM_callocN(sizeof(ARegion), "ui region for file");
+  BLI_addtail(&sfile->regionbase, ar);
+  ar->regiontype = RGN_TYPE_UI;
+  ar->alignment = RGN_ALIGN_TOP;
+  ar->flag |= RGN_FLAG_DYNAMIC_SIZE;
+
   /* Tools region */
   ar = MEM_callocN(sizeof(ARegion), "tools region for file");
   BLI_addtail(&sfile->regionbase, ar);
@@ -84,13 +91,6 @@ static SpaceLink *file_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scen
   ar->regiontype = RGN_TYPE_TOOL_PROPS;
   ar->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV;
 
-  /* ui list region */
-  ar = MEM_callocN(sizeof(ARegion), "ui region for file");
-  BLI_addtail(&sfile->regionbase, ar);
-  ar->regiontype = RGN_TYPE_UI;
-  ar->alignment = RGN_ALIGN_TOP;
-  ar->flag |= RGN_FLAG_DYNAMIC_SIZE;
-
   /* Execute region */
   ar = MEM_callocN(sizeof(ARegion), "execute region for file");
   BLI_addtail(&sfile->regionbase, ar);



More information about the Bf-blender-cvs mailing list