diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-12-18 17:27:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-12-18 17:53:15 +0300 |
commit | d591c8a350310e69d4db23759847fb0df2ff23ae (patch) | |
tree | dc11974b50e0d2d06cdfc5a9fe8f2a2ff735f983 /source/blender/windowmanager/gizmo/WM_gizmo_types.h | |
parent | 5467f3de3a4aca99e678f16356c1d54cda5fb42f (diff) |
Gizmo: add the ability to postpone refreshing while tweaking
This resolves a logical problem using tweak as a fallback tool.
See: T66304#828742
The select action would immediately show the gizmo underneath it,
then the tweak would be handled by the gizmo instead of moving the item
under the cursor.
Currently this works by hiding the gizmo until the tweak event ends.
While it's simpler to check if the gizmo received a mouse-down event,
it causes flickering before each drag event which feels like a glitch.
This is optional for each gizmo type because there are cases where this
can be useful to activate the gizmo immediately (mesh rip for example).
Diffstat (limited to 'source/blender/windowmanager/gizmo/WM_gizmo_types.h')
-rw-r--r-- | source/blender/windowmanager/gizmo/WM_gizmo_types.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/windowmanager/gizmo/WM_gizmo_types.h b/source/blender/windowmanager/gizmo/WM_gizmo_types.h index d3aa333daea..fc876b56de7 100644 --- a/source/blender/windowmanager/gizmo/WM_gizmo_types.h +++ b/source/blender/windowmanager/gizmo/WM_gizmo_types.h @@ -124,8 +124,21 @@ typedef enum eWM_GizmoFlagGroupTypeFlag { /** * This gizmo type supports using the fallback tools keymap. * #wmGizmoGroup.use_tool_fallback will need to be set too. + * + * Often useful in combination with #WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK */ WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP = (1 << 7), + + /** + * Use this from a gizmos refresh callback so we can postpone the refresh operation + * until the tweak operation is finished. + * Only do this when the group doesn't have a highlighted gizmo. + * + * The result for the user is tweak events delay the gizmo from flashing under the users cursor, + * for selection operations. This means gizmos that use this check don't interfere + * with click drag events by popping up under the cursor and catching the tweak event. + */ + WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK = (1 << 8), } eWM_GizmoFlagGroupTypeFlag; /** @@ -447,6 +460,16 @@ typedef struct wmGizmoGroup { /** Errors and warnings storage. */ struct ReportList *reports; + /** Has the same result as hiding all gizmos individually. */ + struct { + /* Reasons for hiding. */ + union { + uint delay_refresh_for_tweak : 1; + }; + /* All, when we only want to check. */ + uint any; + } hide; + bool tag_remove; bool use_fallback_keymap; |