diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-01-12 04:41:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-01-12 04:45:56 +0300 |
commit | 93d30d62e6e46b0eb852c86053d9529495050c5d (patch) | |
tree | 377dd38affe09938b27c7da20c3e02a80707ce47 | |
parent | ff4c9d69ee4bf1764b6f4effa487e29e6c4ab985 (diff) |
User Prefs: app-template option to hide the cursor
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 1 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 5 |
4 files changed, 11 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 3516085602e..cb088f00714 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -320,6 +320,7 @@ class USERPREF_PT_interface(Panel): col.label(text="App Template:") col.label(text="Options intended for use with app-templates only.") col.prop(view, "show_layout_ui") + col.prop(view, "show_view3d_cursor") diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 9e220f4b141..694434d87e8 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -3934,6 +3934,10 @@ static void view3d_main_region_draw_objects(const bContext *C, Scene *scene, Vie static bool is_cursor_visible(Scene *scene) { + if (U.app_flag & USER_APP_VIEW3D_HIDE_CURSOR) { + return false; + } + Object *ob = OBACT; /* don't draw cursor in paint modes, but with a few exceptions */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 3d3e9d1704b..c1ba808ec03 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -710,6 +710,7 @@ typedef enum eUserpref_UI_Flag2 { /* UserDef.app_flag */ typedef enum eUserpref_APP_Flag { USER_APP_LOCK_UI_LAYOUT = (1 << 0), + USER_APP_VIEW3D_HIDE_CURSOR = (1 << 1), } eUserpref_APP_Flag; /* Auto-Keying mode. diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 1258febab61..df74fc12ae1 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3408,6 +3408,11 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show Layout Widgets", "Show screen layout editing UI"); RNA_def_property_update(prop, 0, "rna_userdef_update_ui"); + prop = RNA_def_property(srna, "show_view3d_cursor", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "app_flag", USER_APP_VIEW3D_HIDE_CURSOR); + RNA_def_property_ui_text(prop, "Show 3D View Cursor", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + /* menus */ prop = RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO); |