UI: support red alert on labels, not just buttons.
This commit is contained in:
@@ -2371,6 +2371,10 @@ static uiBut *uiItemL_(uiLayout *layout, const char *name, int icon)
|
||||
but->flag |= UI_BUT_LIST_ITEM;
|
||||
}
|
||||
|
||||
if (layout->redalert) {
|
||||
UI_but_flag_enable(but, UI_BUT_REDALERT);
|
||||
}
|
||||
|
||||
return but;
|
||||
}
|
||||
|
||||
|
||||
@@ -2281,7 +2281,12 @@ static void widget_state(uiWidgetType *wt, int state)
|
||||
|
||||
if (state & UI_BUT_REDALERT) {
|
||||
char red[4] = {255, 0, 0};
|
||||
widget_state_blend(wt->wcol.inner, red, 0.4f);
|
||||
if (wt->draw) {
|
||||
widget_state_blend(wt->wcol.inner, red, 0.4f);
|
||||
}
|
||||
else {
|
||||
widget_state_blend(wt->wcol.text, red, 0.4f);
|
||||
}
|
||||
}
|
||||
|
||||
if (state & UI_BUT_DRAG_MULTI) {
|
||||
@@ -3654,6 +3659,11 @@ static void widget_state_label(uiWidgetType *wt, int state)
|
||||
else
|
||||
UI_GetThemeColor3ubv(TH_TEXT, (unsigned char *)wt->wcol.text);
|
||||
}
|
||||
|
||||
if (state & UI_BUT_REDALERT) {
|
||||
char red[4] = {255, 0, 0};
|
||||
widget_state_blend(wt->wcol.text, red, 0.4f);
|
||||
}
|
||||
}
|
||||
|
||||
static void widget_radiobut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign)
|
||||
|
||||
Reference in New Issue
Block a user