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.
This commit is contained in:
Brecht Van Lommel
2018-06-28 12:06:00 +02:00
parent af9fcb6a33
commit 89e0d9848a
21 changed files with 149 additions and 91 deletions

View File

@@ -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'}

View File

@@ -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'}