diff options
author | Falk David <falkdavid@gmx.de> | 2021-05-06 11:59:41 +0300 |
---|---|---|
committer | Falk David <falkdavid@gmx.de> | 2021-05-06 12:00:22 +0300 |
commit | b24b197cec042de77f12a7165df2f340886effcf (patch) | |
tree | 7c71694e0ae89fc34e9a367a57fb6d1e523dc7b1 /source/blender/editors/space_clip | |
parent | a1069b6c662ffbeba0457164c3ec831678b25fd4 (diff) |
Fix T87983: Motion tracker button tooltips identical
The tooltips for the tracker buttons were all equal (because they all
use the same operator).
This adds the `get_description` operator callback to the
`CLIP_OT_track_markers` operator and returns a more descriptive
tooltip for the different buttons.
Reviewed By: mont29
Maniphest Tasks: T87983
Differential Revision: https://developer.blender.org/D11145
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops_track.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/editors/space_clip/tracking_ops_track.c b/source/blender/editors/space_clip/tracking_ops_track.c index 9882304d97d..ddab613e170 100644 --- a/source/blender/editors/space_clip/tracking_ops_track.c +++ b/source/blender/editors/space_clip/tracking_ops_track.c @@ -25,6 +25,9 @@ #include "BLI_math.h" #include "BLI_utildefines.h" +#include "BLI_string.h" + +#include "BLT_translation.h" #include "BKE_context.h" #include "BKE_global.h" @@ -398,6 +401,28 @@ static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), const wmEven return OPERATOR_PASS_THROUGH; } +static char *track_markers_desc(bContext *UNUSED(C), wmOperatorType *UNUSED(op), PointerRNA *ptr) +{ + const bool backwards = RNA_boolean_get(ptr, "backwards"); + const bool sequence = RNA_boolean_get(ptr, "sequence"); + + if (backwards && sequence) { + return BLI_strdup(TIP_("Track the selected markers backward for the entire clip")); + } + if (backwards && !sequence) { + return BLI_strdup(TIP_("Track the selected markers backward by one frame")); + } + if (!backwards && sequence) { + return BLI_strdup(TIP_("Track the selected markers forward for the entire clip")); + } + if (!backwards && !sequence) { + return BLI_strdup(TIP_("Track the selected markers forward by one frame")); + } + + /* Use default description. */ + return NULL; +} + void CLIP_OT_track_markers(wmOperatorType *ot) { /* identifiers */ @@ -410,6 +435,7 @@ void CLIP_OT_track_markers(wmOperatorType *ot) ot->invoke = track_markers_invoke; ot->modal = track_markers_modal; ot->poll = ED_space_clip_tracking_poll; + ot->get_description = track_markers_desc; /* flags */ ot->flag = OPTYPE_UNDO; |