From 6868202899824a46ee28eb02df74efd76f6e3503 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 11 Jun 2019 11:43:48 +1000 Subject: Fix T62875: Tooltips behave erratically with view gizmos Improvements to behavior for gizmo tool-tips. - 2D gizmos no longer cancel tool-tips on cursor motion (matching the behavior of UI widgets). - 3D gizmos still close on motion since 3D gizmos may have a large on-screen area which would cause them to stay visible even after the cursor has been moved a large distance. The motion threshold is used so they don't close on unintended cursor motion. - Changing highlighted gizmo now cancels the tool-tip & resets the timer. --- source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c') diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index 73fae5fd46a..6915ea91c8e 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -1144,10 +1144,15 @@ struct ARegion *WM_gizmomap_tooltip_init(struct bContext *C, bool *r_exit_on_event) { wmGizmoMap *gzmap = ar->gizmo_map; - *r_exit_on_event = true; + *r_exit_on_event = false; if (gzmap) { wmGizmo *gz = gzmap->gzmap_context.highlight; if (gz) { + wmGizmoGroup *gzgroup = gz->parent_gzgroup; + if ((gzgroup->type->flag & WM_GIZMOGROUPTYPE_3D) != 0) { + /* On screen area of 3D gizmos may be large, exit on cursor motion. */ + *r_exit_on_event = true; + } return UI_tooltip_create_from_gizmo(C, gz); } } -- cgit v1.2.3