diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-01 16:04:51 +0300 |
---|---|---|
committer | Pablo Vazquez <venomgfx@gmail.com> | 2018-06-01 16:11:38 +0300 |
commit | 13ca63d2adad0da7b73ed3e38da53363e1de3428 (patch) | |
tree | dfd194638d2d51d6ab3377b28eca2f1c77ff4ff4 /source/blender/editors/screen/area.c | |
parent | 3b05034935c482bd3cf377b03549df8d87af90d9 (diff) |
Draw background on pulldown widgets if the header is transparent.
Since the viewport header now supports transparency, text on pulldowns
can be hard to read if their color matches the viewport content.
Background is drawn using the 'inner' theme color, that was unused until now.
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index cd7a0904f38..daaa6a31446 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1005,19 +1005,19 @@ static void region_overlap_fix(ScrArea *sa, ARegion *ar) } /* overlapping regions only in the following restricted cases */ -static bool region_is_overlap(ScrArea *sa, ARegion *ar) +bool ED_region_is_overlap(int spacetype, int regiontype) { if (U.uiflag2 & USER_REGION_OVERLAP) { - if (ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_SEQ, SPACE_IMAGE)) { - if (ELEM(ar->regiontype, RGN_TYPE_TOOLS, RGN_TYPE_UI, RGN_TYPE_TOOL_PROPS)) + if (ELEM(spacetype, SPACE_VIEW3D, SPACE_SEQ, SPACE_IMAGE)) { + if (ELEM(regiontype, RGN_TYPE_TOOLS, RGN_TYPE_UI, RGN_TYPE_TOOL_PROPS)) return 1; - if (ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_IMAGE)) { - if (ar->regiontype == RGN_TYPE_HEADER) + if (ELEM(spacetype, SPACE_VIEW3D, SPACE_IMAGE)) { + if (regiontype == RGN_TYPE_HEADER) return 1; } - else if (sa->spacetype == SPACE_SEQ) { - if (ar->regiontype == RGN_TYPE_PREVIEW) + else if (spacetype == SPACE_SEQ) { + if (regiontype == RGN_TYPE_PREVIEW) return 1; } } @@ -1046,7 +1046,7 @@ static void region_rect_recursive(wmWindow *win, ScrArea *sa, ARegion *ar, rcti alignment = ar->alignment & ~RGN_SPLIT_PREV; /* set here, assuming userpref switching forces to call this again */ - ar->overlap = region_is_overlap(sa, ar); + ar->overlap = ED_region_is_overlap(sa->spacetype, ar->regiontype); /* clear state flags first */ ar->flag &= ~RGN_FLAG_TOO_SMALL; |