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>2018-07-11 17:31:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-11 17:32:27 +0300
commitb1c2f4d468c91a257fbc696700521509325aa6f4 (patch)
tree2b6c5fba416ccc8e654749c5e3995e1c5af9c4e6
parent7552972de0a2403d93699ad4a63882080fbde6f3 (diff)
Numeric Input: preference to default to advanced
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py1
-rw-r--r--source/blender/editors/interface/resources.c2
-rw-r--r--source/blender/editors/util/numinput.c19
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c8
5 files changed, 22 insertions, 10 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index ca96c79b2b4..939e958375a 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -434,6 +434,7 @@ class USERPREF_PT_edit(Panel):
col.label(text="Transform:")
col.prop(edit, "use_drag_immediately")
+ col.prop(edit, "use_numeric_input_advanced")
row.separator()
row.separator()
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index c279c949e62..a2b1aa1f251 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1562,7 +1562,7 @@ void init_userdef_do_versions(Main *bmain)
if (!USER_VERSION_ATLEAST(278, 6)) {
/* Clear preference flags for re-use. */
U.flag &= ~(
- USER_FLAG_DEPRECATED_1 | USER_FLAG_DEPRECATED_2 | USER_FLAG_DEPRECATED_3 |
+ USER_FLAG_NUMINPUT_ADVANCED | USER_FLAG_DEPRECATED_2 | USER_FLAG_DEPRECATED_3 |
USER_FLAG_DEPRECATED_6 | USER_FLAG_DEPRECATED_7 |
USER_FLAG_DEPRECATED_9 | USER_DEVELOPER_UI);
U.uiflag &= ~(
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index 8bd5c9640a5..f64182d2ad6 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -276,17 +276,20 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
short dir = STRCUR_DIR_NEXT, mode = STRCUR_JUMP_NONE;
int cur;
-#ifndef USE_FAKE_EDIT
- if ((event->ctrl == 0) && (event->alt == 0) && (event->ascii != '\0') &&
- strchr("01234567890@%^&*-+/{}()[]<>.|", event->ascii))
+#ifdef USE_FAKE_EDIT
+ if (U.flag & USER_FLAG_NUMINPUT_ADVANCED)
+#endif
{
- if (!(n->flag & NUM_EDIT_FULL)) {
- n->flag |= NUM_EDITED;
- n->flag |= NUM_EDIT_FULL;
- n->val_flag[idx] |= NUM_EDITED;
+ if ((event->ctrl == 0) && (event->alt == 0) && (event->ascii != '\0') &&
+ strchr("01234567890@%^&*-+/{}()[]<>.|", event->ascii))
+ {
+ if (!(n->flag & NUM_EDIT_FULL)) {
+ n->flag |= NUM_EDITED;
+ n->flag |= NUM_EDIT_FULL;
+ n->val_flag[idx] |= NUM_EDITED;
+ }
}
}
-#endif
switch (event->type) {
case EVT_MODAL_MAP:
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 45c6b9634f4..5b8f6fcb73f 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -673,7 +673,7 @@ typedef enum eUserPref_Section {
/* UserDef.flag */
typedef enum eUserPref_Flag {
USER_AUTOSAVE = (1 << 0),
- USER_FLAG_DEPRECATED_1 = (1 << 1), /* cleared */
+ USER_FLAG_NUMINPUT_ADVANCED = (1 << 1),
USER_FLAG_DEPRECATED_2 = (1 << 2), /* cleared */
USER_FLAG_DEPRECATED_3 = (1 << 3), /* cleared */
/* USER_SCENEGLOBAL = (1 << 4), deprecated */
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 517e4047515..3d116482656 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -3845,6 +3845,14 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Release confirms",
"Moving things with a mouse drag confirms when releasing the button");
+ prop = RNA_def_property(srna, "use_numeric_input_advanced", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FLAG_NUMINPUT_ADVANCED);
+ RNA_def_property_ui_text(
+ prop, "Default to Advanced Numeric Input",
+ "When entering numbers while transforming, "
+ "default to advanced mode for full math expression evaluation");
+
+
/* Undo */
prop = RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "undosteps");