[Bf-blender-cvs] [b800a05c558] master: Revert "Cleanup: remove unused text.selection_set select option"

Campbell Barton noreply at git.blender.org
Tue Apr 14 15:35:53 CEST 2020


Commit: b800a05c558dd23f4092b69811d91a08f433ae3f
Author: Campbell Barton
Date:   Tue Apr 14 23:09:25 2020 +1000
Branches: master
https://developer.blender.org/rBb800a05c558dd23f4092b69811d91a08f433ae3f

Revert "Cleanup: remove unused text.selection_set select option"

This reverts commit 9af0cdcd9349b6c0fd1cc0e57a58254e21e1bd3b.

Removed this feature because of confusion
caused by incorrect description.

===================================================================

M	release/scripts/presets/keyconfig/keymap_data/blender_default.py
M	release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
M	source/blender/editors/space_text/text_ops.c

===================================================================

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 90df48581bf..ba6e4b2db14 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -2347,6 +2347,8 @@ def km_text(params):
         ("text.scroll", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
         ("text.selection_set", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None),
         ("text.cursor_set", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
+        ("text.selection_set", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
+         {"properties": [("select", True)]}),
         ("text.scroll", {"type": 'WHEELUPMOUSE', "value": 'PRESS'},
          {"properties": [("lines", -1)]}),
         ("text.scroll", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'},
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index 729a1987ab7..3e495a58613 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -1682,6 +1682,8 @@ def km_text(params):
         ("text.scroll", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
         ("text.selection_set", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None),
         ("text.cursor_set", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
+        ("text.selection_set", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
+         {"properties": [("select", True)]}),
         ("text.scroll", {"type": 'WHEELUPMOUSE', "value": 'PRESS'},
          {"properties": [("lines", -1)]}),
         ("text.scroll", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'},
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 26600bd7dbc..b42f2eba35c 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -3244,6 +3244,7 @@ static int text_selection_set_invoke(bContext *C, wmOperator *op, const wmEvent
 
   op->customdata = MEM_callocN(sizeof(SetSelection), "SetCursor");
   ssel = op->customdata;
+  ssel->selecting = RNA_boolean_get(op->ptr, "select");
 
   ssel->mval_prev[0] = event->mval[0];
   ssel->mval_prev[1] = event->mval[1];
@@ -3292,6 +3293,9 @@ void TEXT_OT_selection_set(wmOperatorType *ot)
   ot->modal = text_selection_set_modal;
   ot->cancel = text_selection_set_cancel;
   ot->poll = text_region_edit_poll;
+
+  /* properties */
+  RNA_def_boolean(ot->srna, "select", 0, "Select", "Set selection end rather than cursor");
 }
 
 /** \} */



More information about the Bf-blender-cvs mailing list