diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2020-01-22 20:33:25 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2020-01-22 20:35:47 +0300 |
commit | c68c160e7b4e1b3e921208f545641250c49ebcc3 (patch) | |
tree | c10cdff974e07ec67270984ca8268b43dd4d154b /source/blender/blenloader/intern | |
parent | 8fc68a2e9cf1d983b3d249988ab05905bd24f06f (diff) |
UI: Hide empty Tool-Header in Rendering workspace (Image Editor)
Fixes T71509
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/versioning_defaults.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index bc43d9605e2..8c7a0c4f7b2 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -207,13 +207,20 @@ static void blo_update_defaults_screen(bScreen *screen, } } - /* Show top-bar by default. */ + /* Show tool-header by default (for most cases at least, hide for others). */ + const bool hide_image_tool_header = STREQ(workspace_name, "Rendering"); for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; + for (ARegion *ar = regionbase->first; ar; ar = ar->next) { if (ar->regiontype == RGN_TYPE_TOOL_HEADER) { - ar->flag &= ~(RGN_FLAG_HIDDEN | RGN_FLAG_HIDDEN_BY_USER); + if ((sl->spacetype == SPACE_IMAGE) && hide_image_tool_header) { + ar->flag |= RGN_FLAG_HIDDEN; + } + else { + ar->flag &= ~(RGN_FLAG_HIDDEN | RGN_FLAG_HIDDEN_BY_USER); + } } } } |