[Bf-blender-cvs] [9facbcff808] blender2.8: UI: keep header top/bottom alignment the same when switching editor types.

Brecht Van Lommel noreply at git.blender.org
Sun May 6 20:22:51 CEST 2018


Commit: 9facbcff80807325abd1fb3ea1da81adc9ec18b4
Author: Brecht Van Lommel
Date:   Sun May 6 20:20:40 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9facbcff80807325abd1fb3ea1da81adc9ec18b4

UI: keep header top/bottom alignment the same when switching editor types.

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

M	source/blender/editors/screen/area.c

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

diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 2357f5cdb69..858ef98bcd2 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1806,6 +1806,7 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_ar_exi
 		SpaceLink *sl;
 		/* store sa->type->exit callback */
 		void *sa_exit = sa->type ? sa->type->exit : NULL;
+		int header_alignment = ED_area_header_alignment(sa);
 
 		/* in some cases (opening temp space) we don't want to
 		 * call area exit callback, so we temporarily unset it */
@@ -1844,7 +1845,7 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_ar_exi
 			}
 			sl = NULL;
 		}
-		
+
 		if (sl) {
 			/* swap regions */
 			slold->regionbase = sa->regionbase;
@@ -1870,6 +1871,14 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_ar_exi
 				BLI_listbase_clear(&sl->regionbase);
 			}
 		}
+
+		/* Sync header alignment. */
+		for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) {
+			if (ar->regiontype == RGN_TYPE_HEADER) {
+				ar->alignment = header_alignment;
+				break;
+			}
+		}
 		
 		ED_area_initialize(CTX_wm_manager(C), win, sa);
 		
@@ -2334,7 +2343,7 @@ int ED_area_header_alignment(const ScrArea *area)
 		}
 	}
 
-	return RGN_ALIGN_NONE;
+	return RGN_ALIGN_TOP;
 }
 
 /**



More information about the Bf-blender-cvs mailing list