diff options
author | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-07-29 21:42:53 +0400 |
---|---|---|
committer | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-07-29 21:42:53 +0400 |
commit | 287b24926fefe078e4baae45808a5453b5c731bc (patch) | |
tree | e2336456d73c8b4bb5b9dad80cb475d5ea9c38d5 /release/scripts/startup/bl_ui/space_text.py | |
parent | e382a373f5c26be3279ce91b119cce1b24bec388 (diff) | |
parent | b948459031dd6d0f1ccc81d607a589fd7d1e8ab2 (diff) |
merge with trunk r38787
Diffstat (limited to 'release/scripts/startup/bl_ui/space_text.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_text.py | 60 |
1 files changed, 34 insertions, 26 deletions
diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index 0c3da2f5e1b..93e513acf0a 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -16,7 +16,7 @@ # # ##### END GPL LICENSE BLOCK ##### -# <pep8 compliant> +# <pep8-80 compliant> import bpy from blf import gettext as _ @@ -34,19 +34,21 @@ class TEXT_HT_header(bpy.types.Header): row.template_header() if context.area.show_menus: - sub = row.row(align=True) - sub.menu("TEXT_MT_view") - sub.menu("TEXT_MT_text") + row.menu("TEXT_MT_view") + row.menu("TEXT_MT_text") + if text: - sub.menu("TEXT_MT_edit") - sub.menu("TEXT_MT_format") + row.menu("TEXT_MT_edit") + row.menu("TEXT_MT_format") + + row.menu("TEXT_MT_templates") if text and text.is_modified: - row = layout.row() - row.alert = True - row.operator("text.resolve_conflict", text="", icon='HELP') + sub = row.row() + sub.alert = True + sub.operator("text.resolve_conflict", text="", icon='HELP') - layout.template_ID(st, "text", new="text.new", unlink="text.unlink") + row.template_ID(st, "text", new="text.new", unlink="text.unlink") row = layout.row(align=True) row.prop(st, "show_line_numbers", text="") @@ -64,11 +66,13 @@ class TEXT_HT_header(bpy.types.Header): row = layout.row() if text.filepath: if text.is_dirty: - row.label(text="File: *%s (unsaved)" % text.filepath) + row.label(text=_("File")+": *%r " % text.filepath+_("(unsaved)")) else: - row.label(text="File: %s" % text.filepath) + row.label(text=_("File")+": %r" % text.filepath) else: - row.label(text="Text: External" if text.library else "Text: Internal") + row.label(text=_("Text: External") + if text.library + else _("Text: Internal")) class TEXT_PT_properties(bpy.types.Panel): @@ -151,8 +155,12 @@ class TEXT_MT_view(bpy.types.Menu): layout.separator() - layout.operator("text.move", text=_("Top of File")).type = 'FILE_TOP' - layout.operator("text.move", text=_("Bottom of File")).type = 'FILE_BOTTOM' + layout.operator("text.move", + text=_("Top of File"), + ).type = 'FILE_TOP' + layout.operator("text.move", + text=_("Bottom of File"), + ).type = 'FILE_BOTTOM' class TEXT_MT_text(bpy.types.Menu): @@ -186,19 +194,15 @@ class TEXT_MT_text(bpy.types.Menu): # XXX uiMenuItemO(head, 0, "text.refresh_pyconstraints"); #endif - layout.separator() - - layout.menu("TEXT_MT_templates") - class TEXT_MT_templates(bpy.types.Menu): - ''' - Creates the menu items by scanning scripts/templates - ''' - bl_label = _("Script Templates") + bl_label = _("Templates") def draw(self, context): - self.path_menu(bpy.utils.script_paths("templates"), "text.open", {"internal": True}) + self.path_menu(bpy.utils.script_paths("templates"), + "text.open", + {"internal": True}, + ) class TEXT_MT_edit_select(bpy.types.Menu): @@ -247,8 +251,12 @@ class TEXT_MT_edit_to3d(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.operator("text.to_3d_object", text=_("One Object")).split_lines = False - layout.operator("text.to_3d_object", text=_("One Object Per Line")).split_lines = True + layout.operator("text.to_3d_object", + text=_("One Object"), + ).split_lines = False + layout.operator("text.to_3d_object", + text=_("One Object Per Line"), + ).split_lines = True class TEXT_MT_edit(bpy.types.Menu): |