[Bf-blender-cvs] [89e0d9848a0] blender2.8: UI: keep some operator text in headers.

Brecht Van Lommel noreply at git.blender.org
Thu Jun 28 13:06:29 CEST 2018


Commit: 89e0d9848a0660c81e57f1e5e9778a2b920bd54a
Author: Brecht Van Lommel
Date:   Thu Jun 28 12:06:00 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB89e0d9848a0660c81e57f1e5e9778a2b920bd54a

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.

===================================================================

M	release/scripts/startup/bl_operators/wm.py
M	release/scripts/templates_py/manipulator_custom_geometry.py
M	release/scripts/templates_py/operator_modal_view3d.py
M	source/blender/blenkernel/intern/screen.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/editors/animation/anim_markers.c
M	source/blender/editors/armature/pose_lib.c
M	source/blender/editors/armature/pose_slide.c
M	source/blender/editors/gpencil/gpencil_interpolate.c
M	source/blender/editors/include/ED_screen.h
M	source/blender/editors/mesh/editmesh_bevel.c
M	source/blender/editors/mesh/editmesh_inset.c
M	source/blender/editors/screen/area.c
M	source/blender/editors/screen/screen_edit.c
M	source/blender/editors/space_sequencer/sequencer_edit.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/uvedit/uvedit_unwrap_ops.c
M	source/blender/makesdna/DNA_screen_types.h
M	source/blender/makesrna/intern/rna_screen.c
M	source/blender/makesrna/intern/rna_workspace_api.c
M	source/blender/windowmanager/intern/wm_operators.c

===================================================================

diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 8055ff25090..440beaaa240 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -828,17 +828,17 @@ class WM_OT_context_modal_mouse(Operator):
                     header_text = header_text % eval("item.%s" % self.data_path_item)
                 else:
                     header_text = (self.header_text % delta) + " (delta)"
-                context.workspace.status_text_set(header_text)
+                context.area.header_text_set(header_text)
 
         elif 'LEFTMOUSE' == event_type:
             item = next(iter(self._values.keys()))
             self._values_clear()
-            context.workspace.status_text_set()
+            context.area.header_text_set()
             return operator_value_undo_return(item)
 
         elif event_type in {'RIGHTMOUSE', 'ESC'}:
             self._values_restore()
-            context.workspace.status_text_set()
+            context.area.header_text_set()
             return {'CANCELLED'}
 
         return {'RUNNING_MODAL'}
diff --git a/release/scripts/templates_py/manipulator_custom_geometry.py b/release/scripts/templates_py/manipulator_custom_geometry.py
index 7ebd864e69f..48bb6956f85 100644
--- a/release/scripts/templates_py/manipulator_custom_geometry.py
+++ b/release/scripts/templates_py/manipulator_custom_geometry.py
@@ -96,7 +96,7 @@ class MyCustomShapeWidget(Manipulator):
         return {'RUNNING_MODAL'}
 
     def exit(self, context, cancel):
-        context.workspace.status_text_set()
+        context.area.header_text_set()
         if cancel:
             self.target_set_value("offset", self.init_value)
 
@@ -108,7 +108,7 @@ class MyCustomShapeWidget(Manipulator):
             delta /= 10.0
         value = self.init_value + delta
         self.target_set_value("offset", value)
-        context.workspace.status_text_set("My Manipulator: %.4f" % value)
+        context.area.header_text_set("My Manipulator: %.4f" % value)
         return {'RUNNING_MODAL'}
 
 
diff --git a/release/scripts/templates_py/operator_modal_view3d.py b/release/scripts/templates_py/operator_modal_view3d.py
index be41ea4d714..65bab3489b4 100644
--- a/release/scripts/templates_py/operator_modal_view3d.py
+++ b/release/scripts/templates_py/operator_modal_view3d.py
@@ -26,15 +26,15 @@ class ViewOperator(bpy.types.Operator):
         if event.type == 'MOUSEMOVE':
             self.offset = (self._initial_mouse - Vector((event.mouse_x, event.mouse_y, 0.0))) * 0.02
             self.execute(context)
-            context.workspace.status_text_set("Offset %.4f %.4f %.4f" % tuple(self.offset))
+            context.area.header_text_set("Offset %.4f %.4f %.4f" % tuple(self.offset))
 
         elif event.type == 'LEFTMOUSE':
-            context.workspace.status_text_set()
+            context.area.header_text_set()
             return {'FINISHED'}
 
         elif event.type in {'RIGHTMOUSE', 'ESC'}:
             rv3d.view_location = self._initial_location
-            context.workspace.status_text_set()
+            context.area.header_text_set()
             return {'CANCELLED'}
 
         return {'RUNNING_MODAL'}
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, tGPDint

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list