diff options
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index a78b3ee79c1..f227ac299ab 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1519,29 +1519,26 @@ static int sequencer_slip_exec(bContext *C, wmOperator *op) } -static void sequencer_slip_update_header(Scene *scene, ScrArea *sa, SlipData *data, int offset) +static void sequencer_slip_update_header(bContext *C, Scene *scene, SlipData *data, int offset) { char msg[UI_MAX_DRAW_STR]; - if (sa) { - if (hasNumInput(&data->num_input)) { - char num_str[NUM_STR_REP_LEN]; - outputNumInput(&data->num_input, num_str, &scene->unit); - BLI_snprintf(msg, sizeof(msg), IFACE_("Trim offset: %s"), num_str); - } - else { - BLI_snprintf(msg, sizeof(msg), IFACE_("Trim offset: %d"), offset); - } + if (hasNumInput(&data->num_input)) { + char num_str[NUM_STR_REP_LEN]; + outputNumInput(&data->num_input, num_str, &scene->unit); + BLI_snprintf(msg, sizeof(msg), IFACE_("Trim offset: %s"), num_str); + } + else { + BLI_snprintf(msg, sizeof(msg), IFACE_("Trim offset: %d"), offset); } - ED_area_headerprint(sa, msg); + ED_workspace_status_text(C, msg); } static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); SlipData *data = (SlipData *)op->customdata; - ScrArea *sa = CTX_wm_area(C); const bool has_numInput = hasNumInput(&data->num_input); bool handled = true; @@ -1550,7 +1547,7 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even float offset; applyNumInput(&data->num_input, &offset); - sequencer_slip_update_header(scene, sa, data, (int)offset); + sequencer_slip_update_header(C, scene, data, (int)offset); RNA_int_set(op->ptr, "offset", offset); @@ -1584,7 +1581,7 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even UI_view2d_region_to_view(v2d, mouse_x, 0, &mouseloc[0], &mouseloc[1]); offset = mouseloc[0] - data->init_mouseloc[0]; - sequencer_slip_update_header(scene, sa, data, offset); + sequencer_slip_update_header(C, scene, data, offset); RNA_int_set(op->ptr, "offset", offset); @@ -1604,9 +1601,7 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even MEM_freeN(data->ts); MEM_freeN(data); op->customdata = NULL; - if (sa) { - ED_area_headerprint(sa, NULL); - } + ED_workspace_status_text(C, NULL); WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); return OPERATOR_FINISHED; } @@ -1636,10 +1631,7 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); BKE_sequencer_free_imbuf(scene, &ed->seqbase, false); - - if (sa) { - ED_area_headerprint(sa, NULL); - } + ED_workspace_status_text(C, NULL); return OPERATOR_CANCELLED; } @@ -1667,7 +1659,7 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even float offset; applyNumInput(&data->num_input, &offset); - sequencer_slip_update_header(scene, sa, data, (int)offset); + sequencer_slip_update_header(C, scene, data, (int)offset); RNA_int_set(op->ptr, "offset", offset); |