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 2 additions and 13 deletions
Showing only changes of commit 5b42487f59 - Show all commits

View File

@ -5067,19 +5067,8 @@ void ui_draw_but(const bContext *C, ARegion *region, uiStyle *style, uiBut *but,
state.but_flag &= ~UI_BUT_OVERRIDDEN;
}
if ((state.but_drawflag & UI_BUT_INDETERMINATE)) {
if (state.but_flag & UI_SELECT) {
state.but_flag &= ~UI_SELECT;
}
if (ELEM(but->type,
UI_BTYPE_MENU,
UI_BTYPE_NUM,
UI_BTYPE_NUM_SLIDER,
UI_BTYPE_TEXT,
UI_BTYPE_SEARCH_MENU))
{
state.but_drawflag &= ~(UI_BUT_TEXT_LEFT | UI_BUT_TEXT_RIGHT);
}
if ((state.but_drawflag & UI_BUT_INDETERMINATE) && (state.but_flag & UI_SELECT)) {
state.but_flag &= ~UI_SELECT;
}
Harley marked this conversation as resolved
Review

I'd remove the && (state.but_flag & UI_SELECT) part, just makes the logic look unnecessarily complex.

I'd remove the ` && (state.but_flag & UI_SELECT)` part, just makes the logic look unnecessarily complex.
const float zoom = 1.0f / but->block->aspect;