FIX: Enter didn't work in filebrowser when mouse inside icon or preview

Note: This is yet another problem that results from the fact that the icon/preview in file browser is now a button rather than just drawn as an image. (Similar to LEFMOUSE not working in filebrowser). This should be checked on as the fix might cause issues in the future when using image drag buttons in other parts of Blender.
This commit is contained in:
2010-05-15 11:52:59 +00:00
parent 3db490d20f
commit 95366b3fbb

View File

@@ -2119,8 +2119,13 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, wmE
}
if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val==KM_PRESS) {
int ret = WM_UI_HANDLER_BREAK;
/* XXX (a bit ugly) Special case handling for filebrowser drag button */
if(but->dragpoin && but->imb && ui_but_mouse_inside_icon(but, data->region, event)) {
ret = WM_UI_HANDLER_CONTINUE;
}
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
return ret;
}
}
else if(data->state == BUTTON_STATE_WAIT_DRAG) {