Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-06-25 14:34:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-06-25 15:55:49 +0300
commitd08312463b27651171be1c487633804f6ea98d65 (patch)
tree2add8bb9dd20df5cba03664fdb1917ec13b6a1eb /source/blender/editors/interface/view2d_gizmo_navigate.c
parentf472ac391c18486db1933afa95831adc98fce3d2 (diff)
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.
Diffstat (limited to 'source/blender/editors/interface/view2d_gizmo_navigate.c')
-rw-r--r--source/blender/editors/interface/view2d_gizmo_navigate.c9
1 files changed, 9 insertions, 0 deletions
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;
}