Fix related to T44243: do not systematically do live-update when tab-completing textedit buttons.

We now have a specific flag for that, use it! Note that for all 'search menu' buttons,
there is already a similar behavior, so there is no need to force apply butt in this case
anyway, which means in practice this change only has effect in the single place
it is needed currently - file browser dir/file fields.

In this case (dir field), applying button even on partial matches leads code
to ask to create a new dir, which breaks completely the expected behavior of
completion. And we do not need immediate apply at all here.

Note this is the only 'autocomplete' button not using search menu, so this change
does not affect anything else in UI.
This commit is contained in:
Bastien Montagne 2015-04-03 15:49:52 +02:00
parent 03f2e5d4a6
commit 3f30ebf64a
1 changed files with 1 additions and 3 deletions

View File

@ -2864,8 +2864,6 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
if (autocomplete == AUTOCOMPLETE_FULL_MATCH)
button_activate_state(C, but, BUTTON_STATE_EXIT);
update = true; /* do live update for tab key */
}
/* the hotkey here is not well defined, was G.qual so we check all */
else if (IS_EVENT_MOD(event, shift, ctrl, alt, oskey)) {
@ -2944,7 +2942,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
#endif
if (changed) {
/* only update when typing for TAB key */
/* only do live update when but flag request it (UI_BUT_TEXTEDIT_UPDATE). */
if (update && data->interactive) {
ui_apply_but(C, block, but, data, true);
}