forked from bartvdbraak/blender
User preference to hide Python references in Tooltips.
This commit is contained in:
parent
8f657c174d
commit
19e091ec5e
@ -156,6 +156,7 @@ class USERPREF_PT_interface(bpy.types.Panel):
|
||||
col = row.column()
|
||||
col.label(text="Display:")
|
||||
col.prop(view, "show_tooltips")
|
||||
col.prop(view, "hide_tooltips_python")
|
||||
col.prop(view, "show_object_info", text="Object Info")
|
||||
col.prop(view, "show_large_cursors")
|
||||
col.prop(view, "show_view_name", text="View Name")
|
||||
|
@ -403,9 +403,11 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
|
||||
}
|
||||
|
||||
/* rna info */
|
||||
if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) {
|
||||
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s.%s", RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop));
|
||||
data->color[data->totline]= 0x888888;
|
||||
data->totline++;
|
||||
}
|
||||
|
||||
if(but->rnapoin.id.data) {
|
||||
ID *id= but->rnapoin.id.data;
|
||||
@ -424,9 +426,11 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
|
||||
str= WM_operator_pystring(C, but->optype, opptr, 0);
|
||||
|
||||
/* operator info */
|
||||
if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) {
|
||||
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s", str);
|
||||
data->color[data->totline]= 0x888888;
|
||||
data->totline++;
|
||||
}
|
||||
|
||||
MEM_freeN(str);
|
||||
|
||||
|
@ -425,6 +425,7 @@ extern UserDef U; /* from blenkernel blender.c */
|
||||
#define USER_FILENOUI (1 << 23)
|
||||
#define USER_NONEGFRAMES (1 << 24)
|
||||
#define USER_TXT_TABSTOSPACES_DISABLE (1 << 25)
|
||||
#define USER_TOOLTIPS_PYTHON (1 << 26)
|
||||
|
||||
/* helper macro for checking frame clamping */
|
||||
#define FRAMENUMBER_MIN_CLAMP(cfra) \
|
||||
|
@ -1923,6 +1923,10 @@ static void rna_def_userdef_view(BlenderRNA *brna)
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS);
|
||||
RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips");
|
||||
|
||||
prop= RNA_def_property(srna, "hide_tooltips_python", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS_PYTHON);
|
||||
RNA_def_property_ui_text(prop, "Hide Python Tooltips", "Hide Python references in tooltips");
|
||||
|
||||
prop= RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO);
|
||||
RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3D view");
|
||||
|
Loading…
Reference in New Issue
Block a user