Fix [#20786] Added widget on toolbar does not remove

Fix [#20794] Can't save my file by pressing "Enter" button

- removed the ability to activate a text field by pressing enter when the mouse is over it. This wasn't that practical and now allows the convenient 2.4 behaviour in the file selector filename field, of pressing enter twice to save.
This commit is contained in:
2010-01-25 06:48:04 +00:00
parent 0c5998e799
commit 6b9615edaf

View File

@@ -1949,7 +1949,7 @@ static int ui_do_but_KEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data, w
static int ui_do_but_TEX(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
{
if(data->state == BUTTON_STATE_HIGHLIGHT) {
if(ELEM4(event->type, LEFTMOUSE, PADENTER, RETKEY, EVT_BUT_OPEN) && event->val==KM_PRESS) {
if(ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN) && event->val==KM_PRESS) {
if(but->dt == UI_EMBOSSN && !event->ctrl);
else {
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
@@ -3491,7 +3491,8 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg)
km = WM_keymap_guess_opname(C, but->optype->idname);
kmi = WM_keymap_add_item(km, but->optype->idname, AKEY, KM_PRESS, 0, 0);
MEM_freeN(kmi->properties);
kmi->properties= IDP_CopyProperty(prop);
if (prop)
kmi->properties= IDP_CopyProperty(prop);
RNA_pointer_create(NULL, &RNA_KeyMapItem, kmi, &ptr);