Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_userdef.c
| Show First 20 Lines • Show All 3,298 Lines • ▼ Show 20 Lines | static void rna_def_userdef_view(BlenderRNA *brna) | ||||
| static EnumPropertyItem zoom_frame_modes[] = { | static EnumPropertyItem zoom_frame_modes[] = { | ||||
| {ZOOM_FRAME_MODE_KEEP_RANGE, "KEEP_RANGE", 0, "Keep Range", ""}, | {ZOOM_FRAME_MODE_KEEP_RANGE, "KEEP_RANGE", 0, "Keep Range", ""}, | ||||
| {ZOOM_FRAME_MODE_SECONDS, "SECONDS", 0, "Seconds", ""}, | {ZOOM_FRAME_MODE_SECONDS, "SECONDS", 0, "Seconds", ""}, | ||||
| {ZOOM_FRAME_MODE_KEYFRAMES, "KEYFRAMES", 0, "Keyframes", ""}, | {ZOOM_FRAME_MODE_KEYFRAMES, "KEYFRAMES", 0, "Keyframes", ""}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static EnumPropertyItem line_width[] = { | |||||
| {-1, "THIN", 0, "Thin", "Thinner lines than the default"}, | |||||
| { 0, "AUTO", 0, "Auto", "Automatic line width based on UI scale"}, | |||||
sergey: I am not sure `Default` is a good name, especially since you don't explain what it is in a… | |||||
| { 1, "THICK", 0, "Thick", "Thicker lines than the default"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| srna = RNA_def_struct(brna, "UserPreferencesView", NULL); | srna = RNA_def_struct(brna, "UserPreferencesView", NULL); | ||||
| RNA_def_struct_sdna(srna, "UserDef"); | RNA_def_struct_sdna(srna, "UserDef"); | ||||
| RNA_def_struct_nested(brna, srna, "UserPreferences"); | RNA_def_struct_nested(brna, srna, "UserPreferences"); | ||||
| RNA_def_struct_clear_flag(srna, STRUCT_UNDO); | RNA_def_struct_clear_flag(srna, STRUCT_UNDO); | ||||
| RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data"); | RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data"); | ||||
| /* View */ | /* View */ | ||||
| prop = RNA_def_property(srna, "ui_scale", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "ui_scale", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_ui_text(prop, "UI Scale", "Changes the size of the fonts and buttons in the interface"); | RNA_def_property_ui_text(prop, "UI Scale", "Changes the size of the fonts and buttons in the interface"); | ||||
| RNA_def_property_range(prop, 0.25f, 4.0f); | RNA_def_property_range(prop, 0.25f, 4.0f); | ||||
| RNA_def_property_ui_range(prop, 0.5f, 2.0f, 1, 2); | RNA_def_property_ui_range(prop, 0.5f, 2.0f, 1, 2); | ||||
| RNA_def_property_float_default(prop, 1.0f); | RNA_def_property_float_default(prop, 1.0f); | ||||
| RNA_def_property_update(prop, 0, "rna_userdef_dpi_update"); | RNA_def_property_update(prop, 0, "rna_userdef_dpi_update"); | ||||
| prop = RNA_def_property(srna, "ui_line_width", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, line_width); | |||||
| RNA_def_property_ui_text(prop, "UI Line Width", | |||||
| "Changes the thickness of lines and points in the interface"); | |||||
| RNA_def_property_update(prop, 0, "rna_userdef_dpi_update"); | |||||
| /* display */ | /* display */ | ||||
| prop = RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS); | RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS); | ||||
| RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips (when off hold Alt to force display)"); | RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips (when off hold Alt to force display)"); | ||||
| prop = RNA_def_property(srna, "show_tooltips_python", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_tooltips_python", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TOOLTIPS_PYTHON); | RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TOOLTIPS_PYTHON); | ||||
| RNA_def_property_ui_text(prop, "Python Tooltips", "Show Python references in tooltips"); | RNA_def_property_ui_text(prop, "Python Tooltips", "Show Python references in tooltips"); | ||||
| ▲ Show 20 Lines • Show All 1,412 Lines • Show Last 20 Lines | |||||
I am not sure Default is a good name, especially since you don't explain what it is in a tooltip. It is something which is auto-magically detected by our system.
It is more like Native, assuming it behaves similar to old system where we've initalized line width based on whether it's retina or regular display.
Better name is possible, and surely descriptions are needed.