From 252d1d8e226a9f9c491b81405cd454bfcc263e78 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Thu, 28 Jun 2018 00:28:32 +0200 Subject: UI: Center ID Blocks in Text Editor See T55635 --- release/scripts/startup/bl_ui/space_text.py | 35 +++++++++++++++++------------ 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'release/scripts/startup/bl_ui/space_text.py') diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index b1af82c95fe..eccb0ecdddf 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -41,27 +41,22 @@ class TEXT_HT_header(Header): 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) row.prop(st, "show_line_numbers", text="") row.prop(st, "show_word_wrap", text="") row.prop(st, "show_syntax_highlight", text="") - if text: - osl = text.name.endswith(".osl") or text.name.endswith(".oso") + layout.separator_spacer() - if osl: - row = layout.row() - row.operator("node.shader_script_update") - else: - row = layout.row() - row.operator("text.run_script") + row = layout.row(align=True) + row.template_ID(st, "text", new="text.new", unlink="text.unlink", open="text.open") + + layout.separator_spacer() - row = layout.row() - row.active = text.name.endswith(".py") - row.prop(text, "use_module") + + + if text: + osl = text.name.endswith(".osl") or text.name.endswith(".oso") row = layout.row() if text.filepath: @@ -75,6 +70,18 @@ class TEXT_HT_header(Header): row.label(text="Text: External" if text.library else "Text: Internal") + if osl: + row = layout.row() + row.operator("node.shader_script_update") + else: + row = layout.row() + row.active = text.name.endswith(".py") + row.prop(text, "use_module") + + row = layout.row() + row.operator("text.run_script") + + class TEXT_MT_editor_menus(Menu): -- cgit v1.2.3