UI: HUD now follows region theming
This commit is contained in:
parent
64aadc7c7d
commit
edd0522e8f
Notes:
blender-bot
2023-02-14 05:44:17 +01:00
Referenced by issue #55463, Texture Paint - Eraser brush missing
|
@ -758,7 +758,11 @@ void ui_draw_popover_back(ARegion *ar, struct uiStyle *style, uiBlock *block, rc
|
|||
void ui_draw_pie_center(uiBlock *block);
|
||||
uiWidgetColors *ui_tooltip_get_theme(void);
|
||||
|
||||
void ui_draw_widget_back(uiWidgetTypeEnum type, bool use_shadow, const rcti *rect);
|
||||
void ui_draw_widget_back_color(
|
||||
uiWidgetTypeEnum type, bool use_shadow, const rcti *rect,
|
||||
const float color[4]);
|
||||
void ui_draw_widget_back(
|
||||
uiWidgetTypeEnum type, bool use_shadow, const rcti *rect);
|
||||
void ui_draw_tooltip_background(uiStyle *UNUSED(style), uiBlock *block, rcti *rect);
|
||||
|
||||
extern void ui_draw_but(const struct bContext *C, ARegion *ar, struct uiStyle *style, uiBut *but, rcti *rect);
|
||||
|
|
|
@ -174,7 +174,12 @@ static void hud_region_draw(const bContext *C, ARegion *ar)
|
|||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
if ((ar->flag & RGN_FLAG_HIDDEN) == 0) {
|
||||
ui_draw_widget_back(UI_WTYPE_BOX, false, &(rcti){.xmax = ar->winx, .ymax = ar->winy});
|
||||
float color[4];
|
||||
UI_GetThemeColor4fv(TH_BUTBACK, color);
|
||||
if ((U.uiflag2 & USER_REGION_OVERLAP) == 0) {
|
||||
color[3] = 1.0f;
|
||||
}
|
||||
ui_draw_widget_back_color(UI_WTYPE_BOX, false, &(rcti){.xmax = ar->winx, .ymax = ar->winy}, color);
|
||||
ED_region_panels_draw(C, ar);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4919,7 +4919,9 @@ uiWidgetColors *ui_tooltip_get_theme(void)
|
|||
/**
|
||||
* Generic drawing for background.
|
||||
*/
|
||||
void ui_draw_widget_back(uiWidgetTypeEnum type, bool use_shadow, const rcti *rect)
|
||||
void ui_draw_widget_back_color(
|
||||
uiWidgetTypeEnum type, bool use_shadow, const rcti *rect,
|
||||
const float color[4])
|
||||
{
|
||||
uiWidgetType *wt = widget_type(type);
|
||||
|
||||
|
@ -4931,8 +4933,15 @@ void ui_draw_widget_back(uiWidgetTypeEnum type, bool use_shadow, const rcti *rec
|
|||
|
||||
rcti rect_copy = *rect;
|
||||
wt->state(wt, 0);
|
||||
if (color) {
|
||||
rgba_float_to_uchar((unsigned char *)wt->wcol.inner, color);
|
||||
}
|
||||
wt->draw(&wt->wcol, &rect_copy, 0, UI_CNR_ALL);
|
||||
}
|
||||
void ui_draw_widget_back(uiWidgetTypeEnum type, bool use_shadow, const rcti *rect)
|
||||
{
|
||||
ui_draw_widget_back_color(type, use_shadow, rect, NULL);
|
||||
}
|
||||
|
||||
void ui_draw_tooltip_background(uiStyle *UNUSED(style), uiBlock *UNUSED(block), rcti *rect)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue