Merge branch 'blender-v4.1-release'
This commit is contained in:
@@ -1167,8 +1167,9 @@ static void panel_draw_aligned_backdrop(const ARegion *region,
|
||||
const rcti *rect,
|
||||
const rcti *header_rect)
|
||||
{
|
||||
const bool is_subpanel = panel->type->parent != nullptr;
|
||||
const bool is_open = !UI_panel_is_closed(panel);
|
||||
const bool is_subpanel = panel->type->parent != nullptr;
|
||||
const bool has_header = (panel->type->flag & PANEL_TYPE_NO_HEADER) == 0;
|
||||
|
||||
if (is_subpanel && !is_open) {
|
||||
return;
|
||||
@@ -1182,10 +1183,15 @@ static void panel_draw_aligned_backdrop(const ARegion *region,
|
||||
GPU_blend(GPU_BLEND_ALPHA);
|
||||
|
||||
/* Panel backdrop. */
|
||||
if (is_open || panel->type->flag & PANEL_TYPE_NO_HEADER) {
|
||||
if (is_open || !has_header) {
|
||||
float panel_backcolor[4];
|
||||
UI_draw_roundbox_corner_set(is_open ? UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT : UI_CNR_ALL);
|
||||
UI_GetThemeColor4fv((is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK), panel_backcolor);
|
||||
if (!has_header) {
|
||||
UI_GetThemeColor4fv(TH_BACK, panel_backcolor);
|
||||
}
|
||||
else {
|
||||
UI_GetThemeColor4fv((is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK), panel_backcolor);
|
||||
}
|
||||
|
||||
rctf box_rect;
|
||||
box_rect.xmin = rect->xmin;
|
||||
@@ -1222,7 +1228,7 @@ static void panel_draw_aligned_backdrop(const ARegion *region,
|
||||
}
|
||||
|
||||
/* Panel header backdrops for non sub-panels. */
|
||||
if (!is_subpanel) {
|
||||
if (!is_subpanel && has_header) {
|
||||
float panel_headercolor[4];
|
||||
UI_GetThemeColor4fv(UI_panel_matches_search_filter(panel) ? TH_MATCH : TH_PANEL_HEADER,
|
||||
panel_headercolor);
|
||||
@@ -1259,7 +1265,7 @@ void ui_draw_aligned_panel(const ARegion *region,
|
||||
rect->ymax + int(floor(PNL_HEADER / block->aspect + 0.001f)),
|
||||
};
|
||||
|
||||
if (show_background) {
|
||||
if (show_background || (panel->type->flag & PANEL_TYPE_NO_HEADER)) {
|
||||
panel_draw_aligned_backdrop(region, panel, rect, &header_rect);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user