[Bf-blender-cvs] [e3c8363ce03] master: Fix T83064: Missing tooltips, caused by string property search button

Julian Eisel noreply at git.blender.org
Tue Feb 2 13:54:36 CET 2021


Commit: e3c8363ce03818fde1ef0d9d7c9f13016b34ca54
Author: Julian Eisel
Date:   Tue Feb 2 13:41:32 2021 +0100
Branches: master
https://developer.blender.org/rBe3c8363ce03818fde1ef0d9d7c9f13016b34ca54

Fix T83064: Missing tooltips, caused by string property search button

When a searchbox-button for string properties (e.g. to reference a vertex
group) was created, and a value was set, the tooltip timer would constantly get
cancelled.
That was because the code to validate the current value
(`ui_but_search_refresh()` - early exists for non-string properties) would call
a helper function to update the search results (`ui_searchbox_update_fn()`),
which always reset tooltips. Resetting them in the helper makes sense, for as
long as the searchbox is open. But while it's not, and we just validate the
current value, it shouldn't do this.

This was also noticable in the output settings of dynamic paint, and probably a
number of other cases (especially with script UIs which tend to use string
properties more often).

Likely caused by de53c039adb4.

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

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

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

diff --git a/source/blender/editors/interface/interface_region_search.c b/source/blender/editors/interface/interface_region_search.c
index 7f51eb90fe8..d5a9a94b8ae 100644
--- a/source/blender/editors/interface/interface_region_search.c
+++ b/source/blender/editors/interface/interface_region_search.c
@@ -463,8 +463,11 @@ static void ui_searchbox_update_fn(bContext *C,
                                    const char *str,
                                    uiSearchItems *items)
 {
-  wmWindow *win = CTX_wm_window(C);
-  WM_tooltip_clear(C, win);
+  /* While the button is in text editing mode (searchbox open), remove tooltips on every update. */
+  if (search_but->but.editstr) {
+    wmWindow *win = CTX_wm_window(C);
+    WM_tooltip_clear(C, win);
+  }
   search_but->items_update_fn(C, search_but->arg, str, items);
 }



More information about the Bf-blender-cvs mailing list