diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-16 11:06:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-16 11:07:38 +0300 |
commit | 0e667723d4d51b061036384db29ce7926d437ddf (patch) | |
tree | 7a5ab007cec1186084d45bed8d9551b652956970 /source/blender/editors/interface | |
parent | 65199828766afff21b1a1741fd5a7d651d92f17d (diff) |
UI: Draw background for headerless panels with region-overlap
These were drawing without a backdrop.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 7c60ac75df8..f334d4a921a 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1687,6 +1687,12 @@ void UI_block_draw(const bContext *C, uiBlock *block) } else if (block->panel) { bool show_background = ar->alignment != RGN_ALIGN_FLOAT; + if (show_background) { + if (block->panel->type && (block->panel->type->flag & PNL_NO_HEADER)) { + /* Without a header there is no background except for region overlap. */ + show_background = ar->overlap != 0; + } + } ui_draw_aligned_panel(&style, block, &rect, UI_panel_category_is_visible(ar), show_background); } diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 46b1279643e..aa7ff015bad 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -649,8 +649,17 @@ void ui_draw_aligned_panel(uiStyle *style, /* FIXME(campbell): currently no background means floating panel which * can't be dragged. This may be changed in future. */ show_background); + const int panel_col = is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK; if (panel->type && (panel->type->flag & PNL_NO_HEADER)) { + if (show_background) { + uint pos = GPU_vertformat_attr_add( + immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); + immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immUniformThemeColor(panel_col); + immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax); + immUnbindProgram(); + } return; } @@ -781,8 +790,6 @@ void ui_draw_aligned_panel(uiStyle *style, if (show_background) { /* panel backdrop */ - int panel_col = is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK; - immUniformThemeColor(panel_col); immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax); } |