[Bf-blender-cvs] [3f30ebf] master: Fix related to T44243: do not systematically do live-update when tab-completing textedit buttons.

Bastien Montagne noreply at git.blender.org
Fri Apr 3 16:20:35 CEST 2015


Commit: 3f30ebf64aee964362874aaf985b092b8bc3de8e
Author: Bastien Montagne
Date:   Fri Apr 3 15:49:52 2015 +0200
Branches: master
https://developer.blender.org/rB3f30ebf64aee964362874aaf985b092b8bc3de8e

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.

===================================================================

M	source/blender/editors/interface/interface_handlers.c

===================================================================

diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index b4f2699..bc35fde 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -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);
 		}




More information about the Bf-blender-cvs mailing list