Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Thu, 28 Jun 2018 06:50:11 +0000 (08:50 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 28 Jun 2018 06:50:11 +0000 (08:50 +0200)
1  2 
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_render.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_text.py
release/scripts/startup/bl_ui/space_userpref.py

index af9c0e80ae54cf60c79bb5dfc4a06e7199b0a362,d0067012ffe39a18e87169e954d3432f4c0b706a..37ea88dd546fb262f14b6390f7e31be9898f3d29
@@@ -46,38 -49,38 +46,44 @@@ class TEXT_HT_header(Header)
          row.prop(st, "show_word_wrap", text="")
          row.prop(st, "show_syntax_highlight", text="")
  
 -        if text:
 -            is_osl = text.name.endswith((".osl", ".osl"))
 +        layout.separator_spacer()
  
 -            if is_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")
  
 -                row = layout.row()
 -                row.active = text.name.endswith(".py")
 -                row.prop(text, "use_module")
 +        layout.separator_spacer()
 +
 +        if text:
-             osl = text.name.endswith(".osl") or text.name.endswith(".oso")
++            is_osl = text.name.endswith((".osl", ".osl"))
  
              row = layout.row()
              if text.filepath:
                  if text.is_dirty:
-                     row.label(text=iface_("File: *%r (unsaved)") %
-                               text.filepath, translate=False)
+                     row.label(
+                         iface_(f"File: *{text.filepath} (unsaved)"),
+                         translate=False,
+                     )
                  else:
-                     row.label(text=iface_("File: %r") %
-                               text.filepath, translate=False)
+                     row.label(
+                         iface_(f"File: {text.filepath}"),
+                         translate=False,
+                     )
              else:
-                 row.label(text="Text: External"
-                           if text.library
-                           else "Text: Internal")
+                 row.label(
+                     "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):