diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-02-06 13:15:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-02-06 13:20:15 +0300 |
commit | afd4bf869498782a56304cd127192161a0a40996 (patch) | |
tree | c8469845d8d20636015e5c2ccf24fffc58b1891d /source/blender/blenkernel/intern/screen.c | |
parent | 18e67813cd1b315f77fb194476b357a0e377e6d5 (diff) |
Fix T61136: Header alignment preference has no effect
Users expect this to apply to existing files,
adjust this to apply on load, defaults to off.
Diffstat (limited to 'source/blender/blenkernel/intern/screen.c')
-rw-r--r-- | source/blender/blenkernel/intern/screen.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index 2f1393e43d2..af3384d2023 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -846,3 +846,19 @@ bool BKE_screen_is_used(const bScreen *screen) { return (screen->winid != 0); } + +void BKE_screen_header_alignment_reset(bScreen *screen) +{ + int alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP; + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) { + if (ar->regiontype == RGN_TYPE_HEADER) { + if (ELEM(sa->spacetype, SPACE_FILE, SPACE_USERPREF, SPACE_OUTLINER, SPACE_BUTS)) { + ar->alignment = RGN_ALIGN_TOP; + continue; + } + ar->alignment = alignment; + } + } + } +} |