From d08312463b27651171be1c487633804f6ea98d65 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 25 Jun 2019 21:34:21 +1000 Subject: Preferences: changes to navigation gizmo - Add 'Navigation Buttons' preference, used for 2D views (previously this couldn't be disabled). - Add "Off" option for 3D view axis. - Support minimal axis with navigation buttons. --- source/blender/editors/interface/view2d_gizmo_navigate.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/editors/interface/view2d_gizmo_navigate.c') diff --git a/source/blender/editors/interface/view2d_gizmo_navigate.c b/source/blender/editors/interface/view2d_gizmo_navigate.c index 1ae8dddb75b..1558d0d835f 100644 --- a/source/blender/editors/interface/view2d_gizmo_navigate.c +++ b/source/blender/editors/interface/view2d_gizmo_navigate.c @@ -126,6 +126,14 @@ struct NavigateWidgetGroup { int region_size[2]; }; +static bool WIDGETGROUP_navigate_poll(const bContext *UNUSED(C), wmGizmoGroupType *UNUSED(gzgt)) +{ + if ((U.uiflag & USER_SHOW_GIZMO_NAVIGATE) == 0) { + return false; + } + return true; +} + static void WIDGETGROUP_navigate_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup) { struct NavigateWidgetGroup *navgroup = MEM_callocN(sizeof(struct NavigateWidgetGroup), __func__); @@ -242,6 +250,7 @@ void VIEW2D_GGT_navigate_impl(wmGizmoGroupType *gzgt, const char *idname) gzgt->flag |= (WM_GIZMOGROUPTYPE_PERSISTENT | WM_GIZMOGROUPTYPE_SCALE | WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL); + gzgt->poll = WIDGETGROUP_navigate_poll; gzgt->setup = WIDGETGROUP_navigate_setup; gzgt->draw_prepare = WIDGETGROUP_navigate_draw_prepare; } -- cgit v1.2.3