diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-06 21:20:40 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-06 21:22:43 +0300 |
commit | 9facbcff80807325abd1fb3ea1da81adc9ec18b4 (patch) | |
tree | 448b487b46506bdf8b032127c694c56540bc9378 /source/blender/editors/screen | |
parent | a9ea7864ae0e993be045e58dc924f65f0e20cc03 (diff) |
UI: keep header top/bottom alignment the same when switching editor types.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/area.c | 13 |
1 files changed, 11 insertions, 2 deletions
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; } /** |