UI: uiBut Indeterminate State #108210

Merged
Julian Eisel merged 15 commits from Harley/blender:Indeterminate into main 2023-07-17 19:37:24 +02:00
2 changed files with 6 additions and 1 deletions
Showing only changes of commit 77b1df8ca6 - Show all commits

View File

@ -3799,6 +3799,7 @@ static void ui_but_update_ex(uiBut *but, const bool validate)
if (but->drawflag & UI_BUT_INDETERMINATE) {
Harley marked this conversation as resolved Outdated

I'd rather avoid flags that silently change other flags. Why exactly is this needed?

I'd rather avoid flags that silently change other flags. Why exactly is this needed?
but->drawflag &= ~(UI_BUT_TEXT_LEFT | UI_BUT_TEXT_RIGHT);
but->flag &= ~(UI_SELECT);
}
Harley marked this conversation as resolved Outdated

These comments only explain what it does which is obvious from the code. But why does it do this? And for which button types?

These comments only explain what it does which is obvious from the code. But why does it do this? And for which button types?
/* test for min and max, icon sliders, etc */

View File

@ -3843,6 +3843,10 @@ static void widget_swatch(uiBut *but,
ui_but_v3_get(but, col);
if (but->drawflag & UI_BUT_INDETERMINATE) {
col[0] = col[1] = col[2] = col[3] = 0.5f;
}
if ((state->but_flag & (UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN |
UI_BUT_OVERRIDDEN | UI_BUT_REDALERT)) ||
(state->but_drawflag & UI_BUT_ANIMATED_CHANGED))
@ -4156,7 +4160,7 @@ static void widget_optionbut(uiWidgetColors *wcol,
wcol->inner[0] = wcol->inner_sel[0];
wcol->inner[1] = wcol->inner_sel[1];
wcol->inner[2] = wcol->inner_sel[2];
wcol->inner[3] = 96;
wcol->inner[3] = 60;
}
const float rad = widget_radius_from_rcti(&recttemp, wcol);