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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-28 13:06:00 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-28 14:04:28 +0300
commit89e0d9848a0660c81e57f1e5e9778a2b920bd54a (patch)
tree9c72026a731d04c3663683e52f06f943e78a1a32 /source/blender
parentaf9fcb6a333b575e7f1c2ab1e3d8fbcf1a69b7e1 (diff)
UI: keep some operator text in headers.
Key shortcuts and explanation about how to use the tool should go to the status bar, but other info can in the header so it's near where the user is working. This distinction has not been made yet for all operators.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/screen.c1
-rw-r--r--source/blender/blenloader/intern/readfile.c1
-rw-r--r--source/blender/editors/animation/anim_markers.c4
-rw-r--r--source/blender/editors/armature/pose_lib.c19
-rw-r--r--source/blender/editors/armature/pose_slide.c12
-rw-r--r--source/blender/editors/gpencil/gpencil_interpolate.c12
-rw-r--r--source/blender/editors/include/ED_screen.h1
-rw-r--r--source/blender/editors/mesh/editmesh_bevel.c4
-rw-r--r--source/blender/editors/mesh/editmesh_inset.c4
-rw-r--r--source/blender/editors/screen/area.c34
-rw-r--r--source/blender/editors/screen/screen_edit.c8
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c36
-rw-r--r--source/blender/editors/transform/transform.c62
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c11
-rw-r--r--source/blender/makesdna/DNA_screen_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_screen.c5
-rw-r--r--source/blender/makesrna/intern/rna_workspace_api.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c7
18 files changed, 141 insertions, 83 deletions
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 049c73322c8..4a840b5ffbe 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -224,6 +224,7 @@ ARegion *BKE_area_region_copy(SpaceType *st, ARegion *ar)
newar->visible = 0;
newar->manipulator_map = NULL;
newar->regiontimer = NULL;
+ newar->headerstr = NULL;
newar->draw_buffer = NULL;
/* use optional regiondata callback */
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index a8fec123477..9166caff5e0 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6462,6 +6462,7 @@ static void direct_link_region(FileData *fd, ARegion *ar, int spacetype)
BLI_listbase_clear(&ar->panels_category);
BLI_listbase_clear(&ar->handlers);
BLI_listbase_clear(&ar->uiblocks);
+ ar->headerstr = NULL;
ar->visible = 0;
ar->type = NULL;
ar->do_draw = 0;
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 2815bc58d7a..d8b94a59539 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -770,7 +770,7 @@ static void ed_marker_move_update_header(bContext *C, wmOperator *op)
BLI_snprintf(str, sizeof(str), IFACE_("Marker offset %s"), str_offs);
}
- ED_workspace_status_text(C, str);
+ ED_area_status_text(CTX_wm_area(C), str);
}
/* copy selection to temp buffer */
@@ -830,7 +830,7 @@ static void ed_marker_move_exit(bContext *C, wmOperator *op)
op->customdata = NULL;
/* clear custom header prints */
- ED_workspace_status_text(C, NULL);
+ ED_area_status_text(CTX_wm_area(C), NULL);
}
static int ed_marker_move_invoke(bContext *C, wmOperator *op, const wmEvent *event)
diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c
index b5ae950a28a..46663d7a771 100644
--- a/source/blender/editors/armature/pose_lib.c
+++ b/source/blender/editors/armature/pose_lib.c
@@ -1115,10 +1115,8 @@ static void poselib_preview_apply(bContext *C, wmOperator *op)
/* do header print - if interactively previewing */
if (pld->state == PL_PREVIEW_RUNNING) {
if (pld->flag & PL_PREVIEW_SHOWORIGINAL) {
- BLI_strncpy(pld->headerstr,
- IFACE_("PoseLib Previewing Pose: [Showing Original Pose] | Use Tab to start previewing poses again"),
- sizeof(pld->headerstr));
- ED_workspace_status_text(C, pld->headerstr);
+ ED_area_status_text(pld->sa, IFACE_("PoseLib Previewing Pose: [Showing Original Pose]"));
+ ED_workspace_status_text(C, IFACE_("Use Tab to start previewing poses again"));
}
else if (pld->searchstr[0]) {
char tempstr[65];
@@ -1142,17 +1140,17 @@ static void poselib_preview_apply(bContext *C, wmOperator *op)
BLI_snprintf(pld->headerstr, sizeof(pld->headerstr),
IFACE_("PoseLib Previewing Pose: Filter - [%s] | "
- "Current Pose - \"%s\" | "
- "Use ScrollWheel or PageUp/Down to change"),
+ "Current Pose - \"%s\""),
tempstr, markern);
- ED_workspace_status_text(C, pld->headerstr);
+ ED_area_status_text(pld->sa, pld->headerstr);
+ ED_workspace_status_text(C, IFACE_("Use ScrollWheel or PageUp/Down to change pose"));
}
else {
BLI_snprintf(pld->headerstr, sizeof(pld->headerstr),
- IFACE_("PoseLib Previewing Pose: \"%s\" | "
- "Use ScrollWheel or PageUp/Down to change"),
+ IFACE_("PoseLib Previewing Pose: \"%s\""),
pld->marker->name);
- ED_workspace_status_text(C, pld->headerstr);
+ ED_area_status_text(pld->sa, pld->headerstr);
+ ED_workspace_status_text(C, NULL);
}
}
@@ -1602,6 +1600,7 @@ static void poselib_preview_cleanup(bContext *C, wmOperator *op)
TimeMarker *marker = pld->marker;
/* redraw the header so that it doesn't show any of our stuff anymore */
+ ED_area_status_text(pld->sa, NULL);
ED_workspace_status_text(C, NULL);
/* this signal does one recalc on pose, then unlocks, so ESC or edit will work */
diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c
index 4f2e2397ef4..0a07af4ab43 100644
--- a/source/blender/editors/armature/pose_slide.c
+++ b/source/blender/editors/armature/pose_slide.c
@@ -627,7 +627,7 @@ static void pose_slide_reset(tPoseSlideOp *pso)
/* draw percentage indicator in header */
// TODO: Include hints about locks here...
-static void pose_slide_draw_status(bContext *C, tPoseSlideOp *pso)
+static void pose_slide_draw_status(tPoseSlideOp *pso)
{
char status_str[UI_MAX_DRAW_STR];
char limits_str[UI_MAX_DRAW_STR];
@@ -705,7 +705,7 @@ static void pose_slide_draw_status(bContext *C, tPoseSlideOp *pso)
BLI_snprintf(status_str, sizeof(status_str), "%s: %d %% | %s", mode_str, (int)(pso->percentage * 100.0f), limits_str);
}
- ED_workspace_status_text(C, status_str);
+ ED_area_status_text(pso->sa, status_str);
}
/* common code for invoke() methods */
@@ -781,7 +781,7 @@ static int pose_slide_invoke_common(bContext *C, wmOperator *op, tPoseSlideOp *p
WM_cursor_modal_set(win, BC_EW_SCROLLCURSOR);
/* header print */
- pose_slide_draw_status(C, pso);
+ pose_slide_draw_status(pso);
/* add a modal handler for this operator */
WM_event_add_modal_handler(C, op);
@@ -857,7 +857,7 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event)
case PADENTER:
{
/* return to normal cursor and header status */
- ED_workspace_status_text(C, NULL);
+ ED_area_status_text(pso->sa, NULL);
WM_cursor_modal_restore(win);
/* insert keyframes as required... */
@@ -872,7 +872,7 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event)
case RIGHTMOUSE:
{
/* return to normal cursor and header status */
- ED_workspace_status_text(C, NULL);
+ ED_area_status_text(pso->sa, NULL);
WM_cursor_modal_restore(win);
/* reset transforms back to original state */
@@ -997,7 +997,7 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* perform pose updates - in response to some user action (e.g. pressing a key or moving the mouse) */
if (do_pose_update) {
/* update percentage indicator in header */
- pose_slide_draw_status(C, pso);
+ pose_slide_draw_status(pso);
/* reset transforms (to avoid accumulation errors) */
pose_slide_reset(pso);
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index d7e4be676e5..1b18c6f6731 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -358,19 +358,20 @@ static void gpencil_interpolate_status_indicators(bContext *C, tGPDinterpolate *
char status_str[UI_MAX_DRAW_STR];
char msg_str[UI_MAX_DRAW_STR];
- BLI_strncpy(msg_str, IFACE_("GPencil Interpolation: ESC/RMB to cancel, Enter/LMB to confirm, WHEEL/MOVE to adjust factor"), UI_MAX_DRAW_STR);
+ BLI_strncpy(msg_str, IFACE_("GPencil Interpolation: "), UI_MAX_DRAW_STR);
if (hasNumInput(&p->num)) {
char str_offs[NUM_STR_REP_LEN];
outputNumInput(&p->num, str_offs, &scene->unit);
- BLI_snprintf(status_str, sizeof(status_str), "%s: %s", msg_str, str_offs);
+ BLI_snprintf(status_str, sizeof(status_str), "%s%s", msg_str, str_offs);
}
else {
- BLI_snprintf(status_str, sizeof(status_str), "%s: %d %%", msg_str, (int)((p->init_factor + p->shift) * 100.0f));
+ BLI_snprintf(status_str, sizeof(status_str), "%s%d %%", msg_str, (int)((p->init_factor + p->shift) * 100.0f));
}
- ED_workspace_status_text(C, status_str);
+ ED_area_status_text(p->sa, status_str);
+ ED_workspace_status_text(C, IFACE_("ESC/RMB to cancel, Enter/LMB to confirm, WHEEL/MOVE to adjust factor"));
}
/* Update screen and stroke */
@@ -403,6 +404,7 @@ static void gpencil_interpolate_exit(bContext *C, wmOperator *op)
}
/* clear status message area */
+ ED_area_status_text(tgpi->sa, NULL);
ED_workspace_status_text(C, NULL);
/* finally, free memory used by temp data */
@@ -550,6 +552,7 @@ static int gpencil_interpolate_modal(bContext *C, wmOperator *op, const wmEvent
case RETKEY:
{
/* return to normal cursor and header status */
+ ED_area_status_text(tgpi->sa, NULL);
ED_workspace_status_text(C, NULL);
WM_cursor_modal_restore(win);
@@ -585,6 +588,7 @@ static int gpencil_interpolate_modal(bContext *C, wmOperator *op, const wmEvent
case RIGHTMOUSE:
{
/* return to normal cursor and header status */
+ ED_area_status_text(tgpi->sa, NULL);
ED_workspace_status_text(C, NULL);
WM_cursor_modal_restore(win);
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index 4b0011b92fc..1b5425b54c8 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -143,6 +143,7 @@ void ED_area_tag_redraw_regiontype(ScrArea *sa, int type);
void ED_area_tag_refresh(ScrArea *sa);
void ED_area_do_refresh(struct bContext *C, ScrArea *sa);
void ED_area_azones_update(ScrArea *sa, const int mouse_xy[]);
+void ED_area_status_text(ScrArea *sa, const char *str);
void ED_area_newspace(struct bContext *C, ScrArea *sa, int type, const bool skip_ar_exit);
void ED_area_prevspace(struct bContext *C, ScrArea *sa);
void ED_area_swapspace(struct bContext *C, ScrArea *sa1, ScrArea *sa2);
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index 62271dcdae1..6c5133c93c8 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -130,7 +130,7 @@ static void edbm_bevel_update_header(bContext *C, wmOperator *op)
WM_bool_as_string(opdata->value_mode == PROFILE_VALUE),
offset_str, RNA_int_get(op->ptr, "segments"), RNA_float_get(op->ptr, "profile"));
- ED_workspace_status_text(C, msg);
+ ED_area_status_text(sa, msg);
}
}
@@ -273,7 +273,7 @@ static void edbm_bevel_exit(bContext *C, wmOperator *op)
ScrArea *sa = CTX_wm_area(C);
if (sa) {
- ED_workspace_status_text(C, NULL);
+ ED_area_status_text(sa, NULL);
}
if (opdata->is_modal) {
diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c
index 0fe318f80f0..8758fa66a14 100644
--- a/source/blender/editors/mesh/editmesh_inset.c
+++ b/source/blender/editors/mesh/editmesh_inset.c
@@ -112,7 +112,7 @@ static void edbm_inset_update_header(wmOperator *op, bContext *C)
WM_bool_as_string(RNA_boolean_get(op->ptr, "use_individual"))
);
- ED_workspace_status_text(C, msg);
+ ED_area_status_text(sa, msg);
}
}
@@ -202,7 +202,7 @@ static void edbm_inset_exit(bContext *C, wmOperator *op)
}
if (sa) {
- ED_workspace_status_text(C, NULL);
+ ED_area_status_text(sa, NULL);
}
MEM_SAFE_FREE(opdata->ob_store);
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 9bf15a292ea..a9b163ab58a 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -462,7 +462,15 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
UI_SetTheme(sa ? sa->spacetype : 0, at->regionid);
- if (at->draw) {
+ /* optional header info instead? */
+ if (ar->headerstr) {
+ UI_ThemeClearColor(TH_HEADER);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_FontThemeColor(BLF_default(), TH_TEXT);
+ BLF_draw_default(UI_UNIT_X, 0.4f * UI_UNIT_Y, 0.0f, ar->headerstr, BLF_DRAW_STR_DUMMY_MAX);
+ }
+ else if (at->draw) {
at->draw(C, ar);
}
@@ -633,6 +641,30 @@ void ED_area_tag_refresh(ScrArea *sa)
/* *************************************************************** */
/* use NULL to disable it */
+void ED_area_status_text(ScrArea *sa, const char *str)
+{
+ ARegion *ar;
+
+ /* happens when running transform operators in backround mode */
+ if (sa == NULL)
+ return;
+
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->regiontype == RGN_TYPE_HEADER) {
+ if (str) {
+ if (ar->headerstr == NULL)
+ ar->headerstr = MEM_mallocN(UI_MAX_DRAW_STR, "headerprint");
+ BLI_strncpy(ar->headerstr, str, UI_MAX_DRAW_STR);
+ }
+ else if (ar->headerstr) {
+ MEM_freeN(ar->headerstr);
+ ar->headerstr = NULL;
+ }
+ ED_region_tag_redraw(ar);
+ }
+ }
+}
+
void ED_workspace_status_text(bContext *C, const char *str)
{
wmWindow *win = CTX_wm_window(C);
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index cdd0225e1b7..c067e5a452d 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -876,6 +876,11 @@ void ED_region_exit(bContext *C, ARegion *ar)
WM_event_modal_handler_region_replace(win, ar, NULL);
WM_draw_region_free(ar);
+ if (ar->headerstr) {
+ MEM_freeN(ar->headerstr);
+ ar->headerstr = NULL;
+ }
+
if (ar->regiontimer) {
WM_event_remove_timer(wm, win, ar->regiontimer);
ar->regiontimer = NULL;
@@ -1413,7 +1418,8 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s
}
}
- /* prevent hanging header prints */
+ /* prevent hanging status prints */
+ ED_area_status_text(sa, NULL);
ED_workspace_status_text(C, NULL);
}
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index f227ac299ab..98f63c791af 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -1519,26 +1519,29 @@ static int sequencer_slip_exec(bContext *C, wmOperator *op)
}
-static void sequencer_slip_update_header(bContext *C, Scene *scene, SlipData *data, int offset)
+static void sequencer_slip_update_header(Scene *scene, ScrArea *sa, SlipData *data, int offset)
{
char msg[UI_MAX_DRAW_STR];
- 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 (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);
+ }
}
- ED_workspace_status_text(C, msg);
+ ED_area_status_text(sa, 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;
@@ -1547,7 +1550,7 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even
float offset;
applyNumInput(&data->num_input, &offset);
- sequencer_slip_update_header(C, scene, data, (int)offset);
+ sequencer_slip_update_header(scene, sa, data, (int)offset);
RNA_int_set(op->ptr, "offset", offset);
@@ -1581,7 +1584,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(C, scene, data, offset);
+ sequencer_slip_update_header(scene, sa, data, offset);
RNA_int_set(op->ptr, "offset", offset);
@@ -1601,7 +1604,9 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even
MEM_freeN(data->ts);
MEM_freeN(data);
op->customdata = NULL;
- ED_workspace_status_text(C, NULL);
+ if (sa) {
+ ED_area_status_text(sa, NULL);
+ }
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
}
@@ -1631,7 +1636,10 @@ 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);
- ED_workspace_status_text(C, NULL);
+
+ if (sa) {
+ ED_area_status_text(sa, NULL);
+ }
return OPERATOR_CANCELLED;
}
@@ -1659,7 +1667,7 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even
float offset;
applyNumInput(&data->num_input, &offset);
- sequencer_slip_update_header(C, scene, data, (int)offset);
+ sequencer_slip_update_header(scene, sa, data, (int)offset);
RNA_int_set(op->ptr, "offset", offset);
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 605b13e05ac..c6a6db17a6e 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -652,7 +652,7 @@ static void viewRedrawForce(const bContext *C, TransInfo *t)
static void viewRedrawPost(bContext *C, TransInfo *t)
{
- ED_workspace_status_text(t->context, NULL);
+ ED_area_status_text(t->sa, NULL);
if (t->spacetype == SPACE_VIEW3D) {
/* if autokeying is enabled, send notifiers that keyframes were added */
@@ -3129,7 +3129,7 @@ static void Bend(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -3283,7 +3283,7 @@ static void applyShear(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -3562,7 +3562,7 @@ static void applyResize(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -3665,7 +3665,7 @@ static void applySkinResize(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -3763,7 +3763,7 @@ static void applyToSphere(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -4122,7 +4122,7 @@ static void applyRotation(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -4239,7 +4239,7 @@ static void applyTrackball(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -4568,7 +4568,7 @@ static void applyTranslation(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -4670,7 +4670,7 @@ static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -4749,7 +4749,7 @@ static void applyTilt(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -4830,7 +4830,7 @@ static void applyCurveShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -4936,7 +4936,7 @@ static void applyMaskShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -5017,7 +5017,7 @@ static void applyGPShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -5112,7 +5112,7 @@ static void applyPushPull(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -5194,7 +5194,7 @@ static void applyBevelWeight(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -5279,7 +5279,7 @@ static void applyCrease(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -5402,7 +5402,7 @@ static void applyBoneSize(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -5479,7 +5479,7 @@ static void applyBoneEnvelope(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -7205,7 +7205,7 @@ static void applyEdgeSlide(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -7804,7 +7804,7 @@ static void applyVertSlide(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -7878,7 +7878,7 @@ static void applyBoneRoll(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -7969,7 +7969,7 @@ static void applyBakeTime(TransInfo *t, const int mval[2])
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -8030,7 +8030,7 @@ static void applyMirror(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
else {
size[0] = size[1] = size[2] = 1;
@@ -8053,9 +8053,9 @@ static void applyMirror(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
if (t->flag & T_2D_EDIT)
- ED_workspace_status_text(t->context, IFACE_("Select a mirror axis (X, Y)"));
+ ED_area_status_text(t->sa, IFACE_("Select a mirror axis (X, Y)"));
else
- ED_workspace_status_text(t->context, IFACE_("Select a mirror axis (X, Y, Z)"));
+ ED_area_status_text(t->sa, IFACE_("Select a mirror axis (X, Y, Z)"));
}
}
/** \} */
@@ -8117,7 +8117,7 @@ static void applyAlign(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, IFACE_("Align"));
+ ED_area_status_text(t->sa, IFACE_("Align"));
}
/** \} */
@@ -8216,7 +8216,7 @@ static void applySeqSlide(TransInfo *t, const int mval[2])
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -8500,7 +8500,7 @@ static void applyTimeTranslate(TransInfo *t, const int mval[2])
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -8690,7 +8690,7 @@ static void applyTimeSlide(TransInfo *t, const int mval[2])
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
@@ -8811,7 +8811,7 @@ static void applyTimeScale(TransInfo *t, const int UNUSED(mval[2]))
recalcData(t);
- ED_workspace_status_text(t->context, str);
+ ED_area_status_text(t->sa, str);
}
/** \} */
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 2c54cc3b456..eb14ca9ae2d 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -656,9 +656,9 @@ static void minimize_stretch_iteration(bContext *C, wmOperator *op, bool interac
param_flush(ms->handle);
if (sa) {
- BLI_snprintf(str, sizeof(str),
- IFACE_("Minimize Stretch. Blend %.2f (Press + and -, or scroll wheel to set)"), ms->blend);
- ED_workspace_status_text(C, str);
+ BLI_snprintf(str, sizeof(str), IFACE_("Minimize Stretch. Blend %.2f"), ms->blend);
+ ED_area_status_text(sa, str);
+ ED_workspace_status_text(C, IFACE_("Press + and -, or scroll wheel to set blending"));
}
ms->lasttime = PIL_check_seconds_timer();
@@ -673,8 +673,9 @@ static void minimize_stretch_exit(bContext *C, wmOperator *op, bool cancel)
MinStretch *ms = op->customdata;
ScrArea *sa = CTX_wm_area(C);
- if (sa)
- ED_workspace_status_text(C, NULL);
+ ED_area_status_text(sa, NULL);
+ ED_workspace_status_text(C, NULL);
+
if (ms->timer)
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), ms->timer);
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index f660864d519..500d198fa74 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -351,6 +351,7 @@ typedef struct ARegion {
struct wmTimer *regiontimer; /* blend in/out */
struct wmDrawBuffer *draw_buffer;
+ char *headerstr; /* use this string to draw info */
void *regiondata; /* XXX 2.50, need spacedata equivalent? */
ARegion_Runtime runtime;
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index adbfc33c698..e4921b917f0 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -320,6 +320,7 @@ static void rna_def_area(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
+ FunctionRNA *func;
srna = RNA_def_struct(brna, "Area", NULL);
RNA_def_struct_ui_text(srna, "Area", "Area in a subdivided screen, containing an editor");
@@ -383,6 +384,10 @@ static void rna_def_area(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Height", "Area height");
RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw");
+
+ func = RNA_def_function(srna, "header_text_set", "ED_area_status_text");
+ RNA_def_function_ui_description(func, "Set the header status text");
+ RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text");
}
static void rna_def_view2d_api(StructRNA *srna)
diff --git a/source/blender/makesrna/intern/rna_workspace_api.c b/source/blender/makesrna/intern/rna_workspace_api.c
index 1f3930c7259..0db192e8347 100644
--- a/source/blender/makesrna/intern/rna_workspace_api.c
+++ b/source/blender/makesrna/intern/rna_workspace_api.c
@@ -88,7 +88,7 @@ void RNA_api_workspace(StructRNA *srna)
func = RNA_def_function(srna, "status_text_set", "ED_workspace_status_text");
RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT);
- RNA_def_function_ui_description(func, "Set the status bar text, typically for modal operators");
+ RNA_def_function_ui_description(func, "Set the status bar text, typically key shortcuts for modal operators");
RNA_def_string(func, "text", NULL, 0, "Text", "New string for the status bar, no argument clears the text");
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index b2b82af7992..07026b6c35e 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2436,6 +2436,7 @@ static void radial_control_update_header(wmOperator *op, bContext *C)
{
RadialControl *rc = op->customdata;
char msg[UI_MAX_DRAW_STR];
+ ScrArea *sa = CTX_wm_area(C);
Scene *scene = CTX_data_scene(C);
if (hasNumInput(&rc->num_input)) {
@@ -2468,7 +2469,7 @@ static void radial_control_update_header(wmOperator *op, bContext *C)
}
}
- ED_workspace_status_text(C, msg);
+ ED_area_status_text(sa, msg);
}
static void radial_control_set_initial_mouse(RadialControl *rc, const wmEvent *event)
@@ -3002,9 +3003,7 @@ static void radial_control_cancel(bContext *C, wmOperator *op)
rc->dial = NULL;
}
- if (sa) {
- ED_workspace_status_text(C, NULL);
- }
+ ED_area_status_text(sa, NULL);
WM_paint_cursor_end(wm, rc->cursor);