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-01-24 15:29:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-01-24 15:29:17 +0300
commita47a7f2a7beb0e17d903e058b791aa6eae96bf55 (patch)
treefb28767bf2b0d8d0087b5c6337694bb05b2e41db /source/blender/editors/manipulator_library
parentd8b5b4b7b1cdd3f605bec40f33b3fa9dd5886c04 (diff)
Manipulator: add show_drag option for 2d buttons
Needed so 3d navigation buttons can show show drag cursor only for buttons with modal operators.
Diffstat (limited to 'source/blender/editors/manipulator_library')
-rw-r--r--source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c
index ce6992e7ad9..176c84069a8 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c
@@ -206,9 +206,12 @@ static int manipulator_button2d_test_select(
return -1;
}
-static int manipulator_button2d_cursor_get(wmManipulator *UNUSED(mpr))
+static int manipulator_button2d_cursor_get(wmManipulator *mpr)
{
- return BC_HANDCURSOR;
+ if (RNA_boolean_get(mpr->ptr, "show_drag")) {
+ return BC_NSEW_SCROLLCURSOR;
+ }
+ return CURSOR_STD;
}
static void manipulator_button2d_free(wmManipulator *mpr)
@@ -248,6 +251,9 @@ static void MANIPULATOR_WT_button_2d(wmManipulatorType *wt)
/* Passed to 'GPU_batch_from_poly_2d_encoded' */
RNA_def_property(wt->srna, "shape", PROP_STRING, PROP_BYTESTRING);
+
+ /* Currently only used for cursor display. */
+ RNA_def_boolean(wt->srna, "show_drag", true, "Show Drag", "");
}
void ED_manipulatortypes_button_2d(void)