forked from bartvdbraak/blender
Fix wrong use of enum in UI code to reactive button on mouse over, this worked
only by accident.
This commit is contained in:
parent
020656ceba
commit
4e86946c2b
@ -6302,7 +6302,7 @@ static void ui_handle_button_activate(bContext *C, ARegion *ar, uiBut *but, uiBu
|
|||||||
static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
|
static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
|
||||||
{
|
{
|
||||||
uiHandleButtonData *data = but->active;
|
uiHandleButtonData *data = but->active;
|
||||||
const uiButtonActivateType state_orig = data->state;
|
const uiHandleButtonState state_orig = data->state;
|
||||||
uiBlock *block;
|
uiBlock *block;
|
||||||
ARegion *ar;
|
ARegion *ar;
|
||||||
int retval;
|
int retval;
|
||||||
@ -6474,9 +6474,9 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
|
|||||||
* This is needed to make sure if a button was active,
|
* This is needed to make sure if a button was active,
|
||||||
* it stays active while the mouse is over it.
|
* it stays active while the mouse is over it.
|
||||||
* This avoids adding mousemoves, see: [#33466] */
|
* This avoids adding mousemoves, see: [#33466] */
|
||||||
if (ELEM(state_orig, BUTTON_ACTIVATE, BUTTON_ACTIVATE_OVER)) {
|
if (ELEM(state_orig, BUTTON_STATE_INIT, BUTTON_STATE_HIGHLIGHT)) {
|
||||||
if (ui_but_find_mouse_over(ar, event->x, event->y) == but) {
|
if (ui_but_find_mouse_over(ar, event->x, event->y) == but) {
|
||||||
button_activate_init(C, ar, but, state_orig);
|
button_activate_init(C, ar, but, BUTTON_ACTIVATE_OVER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user