User Prefs: app-template option to hide the cursor

This commit is contained in:
Campbell Barton 2018-01-12 12:41:03 +11:00
parent ff4c9d69ee
commit 93d30d62e6
4 changed files with 11 additions and 0 deletions

View File

@ -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")

View File

@ -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 */

View File

@ -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.

View File

@ -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);