Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/startup/bl_ui/space_text.py')
-rw-r--r--release/scripts/startup/bl_ui/space_text.py33
1 files changed, 13 insertions, 20 deletions
diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py
index 81ccc9216a1..b7c5dcd5437 100644
--- a/release/scripts/startup/bl_ui/space_text.py
+++ b/release/scripts/startup/bl_ui/space_text.py
@@ -30,7 +30,7 @@ class TEXT_HT_header(Header):
st = context.space_data
text = st.text
-
+ is_syntax_highlight_supported = st.is_syntax_highlight_supported()
layout.template_header()
TEXT_MT_editor_menus.draw_collapsible(context, layout)
@@ -43,7 +43,18 @@ class TEXT_HT_header(Header):
layout.separator_spacer()
row = layout.row(align=True)
- row.template_ID(st, "text", new="text.new", unlink="text.unlink", open="text.open")
+ row.template_ID(st, "text", new="text.new",
+ unlink="text.unlink", open="text.open")
+
+ if text:
+ is_osl = text.name.endswith((".osl", ".osl"))
+ if is_osl:
+ row.operator("node.shader_script_update",
+ text="", icon='FILE_REFRESH')
+ else:
+ row = layout.row()
+ row.active = is_syntax_highlight_supported
+ row.operator("text.run_script", text="", icon='PLAY')
layout.separator_spacer()
@@ -51,28 +62,10 @@ class TEXT_HT_header(Header):
row.prop(st, "show_line_numbers", text="")
row.prop(st, "show_word_wrap", text="")
- is_syntax_highlight_supported = st.is_syntax_highlight_supported()
syntax = row.row(align=True)
syntax.active = is_syntax_highlight_supported
syntax.prop(st, "show_syntax_highlight", text="")
- if text:
- text_name = text.name
- is_osl = text_name.endswith((".osl", ".oso"))
-
- row = layout.row()
- if is_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.active = is_syntax_highlight_supported
- row.operator("text.run_script")
-
class TEXT_HT_footer(Header):
bl_space_type = 'TEXT_EDITOR'