From df02675e21736bd79acb0e34bb410efe748a86bc Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 26 Jun 2018 17:19:25 +0200 Subject: UI: move modal operator text from headers to status bar. Python API is context.workspace.status_text_set() --- source/blender/editors/sculpt_paint/paint_image.c | 6 ++---- source/blender/editors/sculpt_paint/sculpt.c | 9 +++------ 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/sculpt_paint') diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 3c097095ddc..c3a0ca4299f 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -886,7 +886,7 @@ static void sample_color_update_header(SampleColorData *data, bContext *C) !data->sample_palette ? IFACE_("Brush. Use Left Click to sample for palette instead") : IFACE_("Palette. Use Left Click to sample more colors")); - ED_area_headerprint(sa, msg); + ED_workspace_status_text(C, msg); } } @@ -965,8 +965,6 @@ static int sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event) Brush *brush = BKE_paint_brush(paint); if ((event->type == data->event_type) && (event->val == KM_RELEASE)) { - ScrArea *sa = CTX_wm_area(C); - if (data->show_cursor) { paint->flags |= PAINT_SHOW_BRUSH; } @@ -977,7 +975,7 @@ static int sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event) } WM_cursor_modal_restore(CTX_wm_window(C)); MEM_freeN(data); - ED_area_headerprint(sa, NULL); + ED_workspace_status_text(C, NULL); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 414b9f2062f..88cb6f548e8 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5970,8 +5970,7 @@ static int sculpt_sample_detail_size_exec(bContext *C, wmOperator *op) static int sculpt_sample_detail_size_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e)) { - ScrArea *sa = CTX_wm_area(C); - ED_area_headerprint(sa, "Click on the mesh to set the detail"); + ED_workspace_status_text(C, "Click on the mesh to set the detail"); WM_cursor_modal_set(CTX_wm_window(C), BC_EYEDROPPER_CURSOR); WM_event_add_modal_handler(C, op); return OPERATOR_RUNNING_MODAL; @@ -5982,14 +5981,13 @@ static int sculpt_sample_detail_size_modal(bContext *C, wmOperator *op, const wm switch (e->type) { case LEFTMOUSE: if (e->val == KM_PRESS) { - ScrArea *sa = CTX_wm_area(C); int ss_co[2] = {e->mval[0], e->mval[1]}; sample_detail(C, ss_co); RNA_int_set_array(op->ptr, "location", ss_co); WM_cursor_modal_restore(CTX_wm_window(C)); - ED_area_headerprint(sa, NULL); + ED_workspace_status_text(C, NULL); WM_main_add_notifier(NC_SCENE | ND_TOOLSETTINGS, NULL); return OPERATOR_FINISHED; @@ -5998,9 +5996,8 @@ static int sculpt_sample_detail_size_modal(bContext *C, wmOperator *op, const wm case RIGHTMOUSE: { - ScrArea *sa = CTX_wm_area(C); WM_cursor_modal_restore(CTX_wm_window(C)); - ED_area_headerprint(sa, NULL); + ED_workspace_status_text(C, NULL); return OPERATOR_CANCELLED; } -- cgit v1.2.3