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
1 changed files with 4 additions and 0 deletions
Showing only changes of commit 1bcef01adc - Show all commits

View File

@ -3797,6 +3797,10 @@ static void ui_but_update_ex(uiBut *but, const bool validate)
}
}
Harley marked this conversation as resolved Outdated

I still can't see an explanation on why this is done, only what it does. Testing the patch, when I simply enable UI_BUT_INDETERMINATE for all buttons, I get a whole bunch of interaction issues/glitches. That is because UI_SELECT is supposed to impact the behavior, not just the drawing.

I guess this should only affect drawing (it's controlled by a draw flag after all), so this should probably be done in ui_draw_but(). At the end of that we already do similar things to safely manipulate flags for drawing.

I still can't see an explanation on _why_ this is done, only what it does. Testing the patch, when I simply enable `UI_BUT_INDETERMINATE` for all buttons, I get a whole bunch of interaction issues/glitches. That is because `UI_SELECT` is supposed to impact the behavior, not just the drawing. I guess this should only affect drawing (it's controlled by a draw flag after all), so this should probably be done in `ui_draw_but()`. At the end of that we already do similar things to safely manipulate flags for drawing.
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);
}
/* test for min and max, icon sliders, etc */
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?
switch (but->type) {
case UI_BTYPE_NUM: