From 3e034831de809cf0d65aec9f4d5b445f875dcff2 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 25 Dec 2014 12:53:13 +0100 Subject: Refactor 'immediate search' feature Currently, code just checks whether a text-edited button uses a given icon (VIEWZOOM) to decide to apply changes on each typed char. This patch adds a propper button flag (UI_BUT_TEXTEDIT_UPDATE) and a dedicated RNA flag (PROP_TEXTEDIT_UPDATE) for that. It's also now usable not only for text buttons, but also for example for num buttons when in 'text edit' mode, etc. It also fixes an actual bug, which is for text properties, in 'immediate' mode, hitting escape would not restore org value, because `ui_apply_but_TEX()` would set its orgstr to NULL on first call (giving it to `but->rename_orig` instead of copying it). Note no change in behavior is expected from user POV. Update for addons using that 'VIEWZOOM' icon 'feature' will follow (if any). Reviewers: campbellbarton Reviewed By: campbellbarton Projects: #user_interface, #bf_blender:_next Differential Revision: https://developer.blender.org/D938 --- source/blender/makesrna/intern/rna_ui.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/makesrna/intern/rna_ui.c') diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 92c5530202b..a61846fa028 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -1062,6 +1062,7 @@ static void rna_def_uilist(BlenderRNA *brna) prop = RNA_def_property(srna, "filter_name", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "filter_byname"); + RNA_def_property_flag(prop, PROP_TEXTEDIT_UPDATE); RNA_def_property_ui_text(prop, "Filter by Name", "Only show items matching this name (use '*' as wildcard)"); prop = RNA_def_property(srna, "use_filter_invert", PROP_BOOLEAN, PROP_NONE); -- cgit v1.2.3