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:
authorGeorge Vogiatzis <Gvgeo>2019-04-05 14:48:26 +0300
committerJacques Lucke <mail@jlucke.com>2019-04-05 14:48:26 +0300
commita180b754eb40637a5d37eeb0ae60066f5a6f93d8 (patch)
tree3871e253a8f3b861b27dfd3f666535adffc606b0 /release/scripts/startup/bl_ui
parentfce469a30c5075216671f9ce3738ed401ad9c03f (diff)
Interface: New region type 'Footer', used by text editor
* It can be hidden by dragging it up/down. * It can be at the top or bottom, independent of the header. * It uses the color theme from the header. * It does not change its color, when the area becomes active. Currently, it is used in the text editor to display the file path. Differential Revision: https://developer.blender.org/D4601
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r--release/scripts/startup/bl_ui/space_text.py34
1 files changed, 24 insertions, 10 deletions
diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py
index 6726a5d319d..b62e2d740b3 100644
--- a/release/scripts/startup/bl_ui/space_text.py
+++ b/release/scripts/startup/bl_ui/space_text.py
@@ -57,6 +57,29 @@ class TEXT_HT_header(Header):
is_osl = text.name.endswith((".osl", ".osl"))
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.operator("text.run_script")
+
+
+class TEXT_HT_footer(Header):
+ bl_space_type = 'TEXT_EDITOR'
+ bl_region_type = 'FOOTER'
+
+ def draw(self, context):
+ layout = self.layout
+
+ st = context.space_data
+ text = st.text
+ if text:
+ row = layout.row()
if text.filepath:
if text.is_dirty:
row.label(
@@ -74,16 +97,6 @@ class TEXT_HT_header(Header):
if text.library
else "Text: Internal"
)
- 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.operator("text.run_script")
class TEXT_MT_editor_menus(Menu):
@@ -353,6 +366,7 @@ class TEXT_MT_toolbox(Menu):
classes = (
TEXT_HT_header,
+ TEXT_HT_footer,
TEXT_MT_edit,
TEXT_MT_editor_menus,
TEXT_PT_properties,