UI: keep navigation gizmos visible during modal operators

Hiding viewport navigation gizmos caused the UI to "flicker"
unnecessarily, the axis could also be useful as a reference.

Resolves T73684
This commit is contained in:
Campbell Barton
2021-09-14 12:49:36 +10:00
parent 9b0b78d58f
commit 917a972b56
5 changed files with 12 additions and 4 deletions

View File

@@ -310,7 +310,7 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal)
if (v3d) {
opdata->gizmo_flag = v3d->gizmo_flag;
v3d->gizmo_flag = V3D_GIZMO_HIDE;
v3d->gizmo_flag |= V3D_GIZMO_HIDE_DEFAULT_MODAL;
}
}

View File

@@ -182,7 +182,7 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
/* Misc other vars. */
G.moving = G_TRANSFORM_EDIT;
opdata->gizmo_flag = v3d->gizmo_flag;
v3d->gizmo_flag = V3D_GIZMO_HIDE;
v3d->gizmo_flag |= V3D_GIZMO_HIDE_DEFAULT_MODAL;
/* Initialize modal callout. */
ED_workspace_status_text(C, TIP_("LMB: Click and drag to draw cut line"));

View File

@@ -191,7 +191,7 @@ static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal)
G.moving = G_TRANSFORM_EDIT;
if (v3d) {
opdata->gizmo_flag = v3d->gizmo_flag;
v3d->gizmo_flag = V3D_GIZMO_HIDE;
v3d->gizmo_flag |= V3D_GIZMO_HIDE_DEFAULT_MODAL;
}
}

View File

@@ -252,7 +252,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
/* turn gizmo off during transform */
if (t->flag & T_MODAL) {
t->gizmo_flag = v3d->gizmo_flag;
v3d->gizmo_flag = V3D_GIZMO_HIDE;
v3d->gizmo_flag |= V3D_GIZMO_HIDE_DEFAULT_MODAL;
}
if (t->scene->toolsettings->transform_flag & SCE_XFORM_AXIS_ALIGN) {

View File

@@ -610,6 +610,14 @@ enum {
V3D_GIZMO_HIDE_TOOL = (1 << 3),
};
/**
* Hide these gizmos when modal operators are active,
* the intention is to hide all gizmos except for navigation since from a user-perspective
* these are closer to UI-level interface elements. Hiding them makes the UI flicker, also,
* the 3D view-axis can be useful to see during interactions.
*/
#define V3D_GIZMO_HIDE_DEFAULT_MODAL (V3D_GIZMO_HIDE_CONTEXT | V3D_GIZMO_HIDE_TOOL)
/** #View3d.gizmo_show_object */
enum {
V3D_GIZMO_SHOW_OBJECT_TRANSLATE = (1 << 0),