[Bf-blender-cvs] [8e6d6cc] master: Fix T48001: Highlighting selected item in filtered lists.

Bastien Montagne noreply at git.blender.org
Fri Apr 1 16:55:50 CEST 2016


Commit: 8e6d6cc4dc2b19b6d9db42a1c9057fdf8c6c5404
Author: Bastien Montagne
Date:   Fri Apr 1 16:54:01 2016 +0200
Branches: master
https://developer.blender.org/rB8e6d6cc4dc2b19b6d9db42a1c9057fdf8c6c5404

Fix T48001: Highlighting selected item in filtered lists.

active index was not reset to 'nothing' in case actual active item was filtered out.

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

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

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

diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 9f98c0d..a47d608 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -3023,7 +3023,7 @@ void uiTemplateList(
 						/* So that we do not map again activei! */
 						activei_mapping_pending = false;
 					}
-# if 0 /* For now, do not alter active element, even if it will be hidden... */
+#if 0 /* For now, do not alter active element, even if it will be hidden... */
 					else if (activei < i) {
 						/* We do not want an active but invisible item!
 						 * Only exception is when all items are filtered out...
@@ -3044,6 +3044,11 @@ void uiTemplateList(
 				i++;
 			}
 			RNA_PROP_END;
+
+			if (activei_mapping_pending) {
+				/* No active item found, set to 'invalid' -1 value... */
+				activei = -1;
+			}
 		}
 		if (dyn_data->items_shown >= 0) {
 			len = dyn_data->items_shown;




More information about the Bf-blender-cvs mailing list