UI: Hide empty Tool-Header in Rendering workspace (Image Editor)
Fixes T71509
This commit is contained in:
parent
8fc68a2e9c
commit
c68c160e7b
Notes:
blender-bot
2023-02-14 10:04:50 +01:00
Referenced by issue #71509, Rendering Workspace header has 2 row height
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue