Change confusing check discovered while working on HCL color wheel:

COLOR widgets never get created with UI_GRAD_V_ALT values. This is
intended for HSVCUBE color sliders only so reverting this to old value
before it was substituted with a define, which was -1.

There's one case where COLOR buttons get defined with a1 value different
than -1 which is in ui_def_but_rna. There the step value of the RNA
property is used. However, that meant that if step equaled to 9, which
is UI_GRAD_V_ALT value (unlikely) or if UI_GRAD_V_ALT was changed to 10
in future, or we added check for e.g. UI_GRAD_L_ALT which is 10 in HCL
branch, color widget would not get a color selection menu spawned.
This commit is contained in:
Antonis Ryakiotakis 2014-02-05 10:45:14 +02:00
parent 88843caaa3
commit fc9626b1df
2 changed files with 2 additions and 2 deletions

View File

@ -5822,7 +5822,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
retval = ui_do_but_BUT(C, but, data, event);
break;
case COLOR:
if (but->a1 == UI_GRAD_V_ALT) /* signal to prevent calling up color picker */
if (but->a1 == -1) /* signal to prevent calling up color picker */
retval = ui_do_but_EXIT(C, but, data, event);
else
retval = ui_do_but_COLOR(C, but, data, event);

View File

@ -181,7 +181,7 @@ struct uiBut {
/* both these values use depends on the button type
* (polymorphic struct or union would be nicer for this stuff) */
/* (type == COLOR), Use UI_GRAD_* values.
/* (type == HSVCUBE), Use UI_GRAD_* values.
* (type == NUM), Use to store RNA 'step' value, for dragging and click-step.
* (type == LABEL), Use (a1 == 1.0f) to use a2 as a blending factor (wow, this is imaginative!).
* (type == SCROLL) Use as scroll size.