Page MenuHome

UI: 3D Viewport text edit menus
AcceptedPublic

Authored by Aaron Carlisle (Blendify) on Thu, Mar 19, 11:59 PM.

Details

Summary
  • Adds select menu
  • Removes undo/redo controls
  • Adds delete menu

The goal is to match other edit menus better and match the text editor.

Diff Detail

Event Timeline

Some class renames were needed because text objects are internally called fontobjects but the mode is called text_edit grr...

Rename edit menu to text menu

Maybe font menu and text menu should be combined?

@William Reynish (billreynish) was that an affirmative answer to combine the menus or just a thumbs up on the patch.

@Aaron Carlisle (Blendify) Indeed, there seems to be no real logical difference between Text and Font already, since the Uppercase operators are in the Text menu, but the Bold/Italic etc controls are in Font. Might as well combine these indeed.

Julian Eisel (Severin) requested changes to this revision.Wed, Mar 25, 6:34 PM

Agree, Text and Font should be merged. There is a logical difference between text and font, but I don't think it's useful to make it explicit here.

Why use the term "Page" in the Select menu? The operator properties are named that way because it's the key it uses I guess (ugly too!), but it doesn't make much sense in the UI. I'd expect "Previous/Next Paragraph". Although looking at the text properties, we there is a "Paragraph" panel for something unrelated.... @William Reynish (billreynish) do you see why the panel is called that way? Seems random. https://docs.blender.org/manual/en/dev/modeling/texts/properties.html#paragraph

Besides these points, this should be fine.

This revision now requires changes to proceed.Wed, Mar 25, 6:34 PM

Why use the term "Page" in the Select menu? The operator properties are named that way because it's the key it uses I guess (ugly too!), but it doesn't make much sense in the UI.

This operator jumps through text 10 lines at a time. Other software uses Page Up / Down to go to the beginning and end of the file. Ctrl up and crlt down are used to move between paragraphs, it seems the logic here needs to be changed/expanded.

Although looking at the text properties, we there is a "Paragraph" panel for something unrelated.... @William Sitton (william) Reynish (billreynish) do you see why the panel is called that way? Seems random.

Blender does not distinguish between a paragraph break and a line break, so it might be a bit miss leading. It is standard practice in a text editor to group these settings under "Paragraph"

Blender does not distinguish between a paragraph break and a line break, so it might be a bit miss leading. It is standard practice in a text editor to group these settings under "Paragraph"

Don't these buttons apply to the selected or current paragraphs only though? In Blender they apply to the entire text object.

Correct, perhaps we need separate edit mode properties that apply to the selected text only.

  • Refactor
  • Combine Menus

Correct, perhaps we need separate edit mode properties that apply to the selected text only.

Regardless of what we do, the panel should not be called "Paragraph" if its settings apply to the entire text object.

The only thing holding me back from accepting is usage of the term "Page". It doesn't fit here at all IMO.

What about the term "Block" the operator jumps 10 lines so these 10 lines are a "Block" of text?

Alternatives are comment out until better logic is added, or terms like chunk or hunk.

What about the term "Block" the operator jumps 10 lines so these 10 lines are a "Block" of text?

Sounds fine.

Adjust name

Note that this patch requires the following addon change:

1diff --git a/space_view3d_spacebar_menu/__init__.py b/space_view3d_spacebar_menu/__init__.py
2index 0ac50e2d..bc39a2bb 100644
3--- a/space_view3d_spacebar_menu/__init__.py
4+++ b/space_view3d_spacebar_menu/__init__.py
5@@ -897,7 +897,7 @@ def register():
6 for cls in classes:
7 bpy.utils.register_class(cls)
8
9- bpy.types.VIEW3D_MT_edit_text_context_menu.append(menu_func)
10+ bpy.types.VIEW3D_MT_edit_font_context_menu.append(menu_func)
11
12 object_menus.register()
13 edit_mesh.register()
14@@ -942,7 +942,7 @@ def unregister():
15 for cls in reversed(classes):
16 bpy.utils.unregister_class(cls)
17
18- bpy.types.VIEW3D_MT_edit_text_context_menu.remove(menu_func)
19+ bpy.types.VIEW3D_MT_edit_font_context_menu.remove(menu_func)
20
21 if __name__ == "__main__":
22 register()

Fine from my side, but I'd like feedback from @William Reynish (billreynish) too.

This revision is now accepted and ready to land.Thu, Mar 26, 11:40 AM