diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/space_text.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_text.py | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index 32cb1009492..a430fb09165 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -34,21 +34,14 @@ class TEXT_HT_header(Header): row = layout.row(align=True) row.template_header() - if context.area.show_menus: - row.menu("TEXT_MT_view") - row.menu("TEXT_MT_text") - - if text: - row.menu("TEXT_MT_edit") - row.menu("TEXT_MT_format") - - row.menu("TEXT_MT_templates") + TEXT_MT_editor_menus.draw_collapsible(context, layout) if text and text.is_modified: sub = row.row(align=True) sub.alert = True sub.operator("text.resolve_conflict", text="", icon='HELP') + row = layout.row(align=True) row.template_ID(st, "text", new="text.new", unlink="text.unlink", open="text.open") row = layout.row(align=True) @@ -84,6 +77,28 @@ class TEXT_HT_header(Header): else "Text: Internal") +class TEXT_MT_editor_menus(Menu): + bl_idname = "TEXT_MT_editor_menus" + bl_label = "" + + def draw(self, context): + self.draw_menus(self.layout, context) + + @staticmethod + def draw_menus(layout, context): + st = context.space_data + text = st.text + + layout.menu("TEXT_MT_view") + layout.menu("TEXT_MT_text") + + if text: + layout.menu("TEXT_MT_edit") + layout.menu("TEXT_MT_format") + + layout.menu("TEXT_MT_templates") + + class TEXT_PT_properties(Panel): bl_space_type = 'TEXT_EDITOR' bl_region_type = 'UI' |