Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_text.py
| Context not available. | |||||
| layout.separator_spacer() | layout.separator_spacer() | ||||
| 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="") | |||||
| layout.separator_spacer() | |||||
| if text: | if text: | ||||
| is_osl = text.name.endswith((".osl", ".osl")) | is_osl = text.name.endswith((".osl", ".osl")) | ||||
| Context not available. | |||||
| row = layout.row() | row = layout.row() | ||||
| row.operator("node.shader_script_update") | row.operator("node.shader_script_update") | ||||
| else: | else: | ||||
| row = layout.row() | |||||
| row.active = text.name.endswith(".py") | |||||
| row.prop(text, "use_module") | |||||
campbellbarton: Would rather not remove this from the header, it's has significant side effects and it's… | |||||
| row = layout.row() | row = layout.row() | ||||
| row.operator("text.run_script") | row.operator("text.run_script") | ||||
| Context not available. | |||||
| layout.menu("TEXT_MT_text") | layout.menu("TEXT_MT_text") | ||||
| if text: | if text: | ||||
| layout.menu("TEXT_MT_select") | |||||
| layout.menu("TEXT_MT_edit") | layout.menu("TEXT_MT_edit") | ||||
| layout.menu("TEXT_MT_format") | layout.menu("TEXT_MT_format") | ||||
| Context not available. | |||||
| row.prop(st, "use_find_all", text="All", toggle=True) | row.prop(st, "use_find_all", text="All", toggle=True) | ||||
| class TEXT_MT_view_navigation(Menu): | |||||
| bl_label = "Navigation" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| st = context.space_data | |||||
| layout.operator("text.move", | |||||
| text="Top", | |||||
| ).type = 'FILE_TOP' | |||||
| layout.operator("text.move", | |||||
| text="Bottom", | |||||
| ).type = 'FILE_BOTTOM' | |||||
| layout.separator() | |||||
| layout.operator("text.move", | |||||
| text="Line Begin", | |||||
| ).type = 'LINE_BEGIN' | |||||
| layout.operator("text.move", | |||||
| text="Line End", | |||||
| ).type = 'LINE_END' | |||||
| layout.separator() | |||||
| layout.operator("text.move", | |||||
| text="Previous Line", | |||||
| ).type = 'PREVIOUS_LINE' | |||||
| layout.operator("text.move", | |||||
| text="Next Line", | |||||
| ).type = 'NEXT_LINE' | |||||
| layout.separator() | |||||
| layout.operator("text.move", | |||||
| text="Previous Word", | |||||
| ).type = 'PREVIOUS_WORD' | |||||
| layout.operator("text.move", | |||||
| text="Next Word", | |||||
| ).type = 'NEXT_WORD' | |||||
| class TEXT_MT_view(Menu): | class TEXT_MT_view(Menu): | ||||
| bl_label = "View" | bl_label = "View" | ||||
| Context not available. | |||||
| layout.separator() | layout.separator() | ||||
| layout.operator("text.move", | layout.prop(st, "use_live_edit") | ||||
| text="Top of File", | |||||
| ).type = 'FILE_TOP' | layout.separator() | ||||
| layout.operator("text.move", | |||||
| text="Bottom of File", | layout.menu("TEXT_MT_view_navigation") | ||||
| ).type = 'FILE_BOTTOM' | |||||
| layout.separator() | layout.separator() | ||||
| Context not available. | |||||
| st = context.space_data | st = context.space_data | ||||
| text = st.text | text = st.text | ||||
| layout.operator("text.new", text="New") | layout.operator("text.new", text="New", icon="FILE_NEW") | ||||
| layout.operator("text.open", text="Open...", icon='FILE_FOLDER') | layout.operator("text.open", text="Open...", icon='FILE_FOLDER') | ||||
| if text: | if text: | ||||
| layout.separator() | layout.separator() | ||||
Done Inline ActionsPy-constraints are not available in the interface. Also name "Refresh" isn't meaningful. campbellbarton: Py-constraints are not available in the interface.
Also name "Refresh" isn't meaningful. | |||||
| layout.operator("text.reload") | layout.operator("text.reload") | ||||
| layout.operator("text.refresh_pyconstraints", text="Refresh") | |||||
| layout.separator() | layout.separator() | ||||
| layout.operator("text.save", icon='FILE_TICK') | layout.operator("text.save", icon='FILE_TICK') | ||||
| layout.operator("text.save_as", text="Save As...") | layout.operator("text.save_as", text="Save As...") | ||||
| layout.separator() | |||||
| if text.filepath: | if text.filepath: | ||||
| layout.operator("text.make_internal") | layout.operator("text.make_internal") | ||||
| layout.separator() | |||||
| row = layout.row() | |||||
| row.active = text.name.endswith(".py") | |||||
| row.prop(text, "use_module") | |||||
| layout.separator() | layout.separator() | ||||
| layout.operator("text.run_script") | layout.operator("text.run_script") | ||||
| Context not available. | |||||
| layout.menu("TEXT_MT_templates_osl") | layout.menu("TEXT_MT_templates_osl") | ||||
| class TEXT_MT_edit_select(Menu): | class TEXT_MT_select(Menu): | ||||
| bl_label = "Select" | bl_label = "Select" | ||||
| def draw(self, _context): | def draw(self, _context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.operator("text.select_all") | layout.operator("text.select_all", text="All") | ||||
| layout.operator("text.select_line") | layout.operator("text.select_line", text="Line") | ||||
| layout.separator() | |||||
Done Inline ActionsWrapping args seems unnecessary here. campbellbarton: Wrapping args seems unnecessary here. | |||||
| layout.operator("text.move_select", | |||||
| text="Top", | |||||
| ).type = 'FILE_TOP' | |||||
| layout.operator("text.move_select", | |||||
| text="Bottom", | |||||
| ).type = 'FILE_BOTTOM' | |||||
| layout.separator() | |||||
| layout.operator("text.move_select", | |||||
| text="Line Begin", | |||||
| ).type = 'LINE_BEGIN' | |||||
| layout.operator("text.move_select", | |||||
| text="Line End", | |||||
| ).type = 'LINE_END' | |||||
| layout.separator() | |||||
| layout.operator("text.move_select", | |||||
| text="Previous Line", | |||||
| ).type = 'PREVIOUS_LINE' | |||||
| layout.operator("text.move_select", | |||||
| text="Next Line", | |||||
| ).type = 'NEXT_LINE' | |||||
| layout.separator() | |||||
| layout.operator("text.move_select", | |||||
| text="Previous Word", | |||||
| ).type = 'PREVIOUS_WORD' | |||||
| layout.operator("text.move_select", | |||||
| text="Next Word", | |||||
| ).type = 'NEXT_WORD' | |||||
| class TEXT_MT_format(Menu): | class TEXT_MT_format(Menu): | ||||
| Context not available. | |||||
| layout.separator() | layout.separator() | ||||
| layout.operator("text.comment_toggle") | layout.operator("text.comment_toggle", text="Toggle Comment") | ||||
| layout.separator() | layout.separator() | ||||
| Context not available. | |||||
| layout.separator() | layout.separator() | ||||
| layout.prop(st, "use_live_edit") | |||||
| layout.separator() | |||||
| layout.operator("text.move_lines", | layout.operator("text.move_lines", | ||||
| text="Move line(s) up").direction = 'UP' | text="Move Up").direction = 'UP' | ||||
| layout.operator("text.move_lines", | layout.operator("text.move_lines", | ||||
Done Inline ActionsRenaming Move Line(s) Up to Move Up looses useful information since this works both with/without selection, makes it seem as if might move the cursor up. campbellbarton: Renaming `Move Line(s) Up` to `Move Up` looses useful information since this works both… | |||||
| text="Move line(s) down").direction = 'DOWN' | text="Move Down").direction = 'DOWN' | ||||
| layout.separator() | layout.separator() | ||||
| layout.menu("TEXT_MT_edit_select") | layout.operator("text.start_find", text="Find & Replace...") | ||||
| layout.operator("text.find_set_selected", text="Find Next") | |||||
| layout.operator("text.jump", text="Jump To...") | |||||
| layout.separator() | layout.separator() | ||||
| layout.operator("text.jump") | |||||
| layout.operator("text.start_find", text="Find...") | |||||
| layout.operator("text.autocomplete") | layout.operator("text.autocomplete") | ||||
| layout.separator() | layout.separator() | ||||
Not Done Inline ActionsOperators name "Toggle Comments" seems fine, since it operates on multiple comments. campbellbarton: Operators name "Toggle Comments" seems fine, since it operates on multiple comments. | |||||
| Context not available. | |||||
| layout.operator_context = 'INVOKE_DEFAULT' | layout.operator_context = 'INVOKE_DEFAULT' | ||||
| layout.operator("ed.undo") | |||||
| layout.operator("ed.redo") | |||||
| layout.separator() | |||||
| layout.operator("text.cut") | layout.operator("text.cut") | ||||
| layout.operator("text.copy", icon='COPYDOWN') | layout.operator("text.copy", icon='COPYDOWN') | ||||
| layout.operator("text.paste", icon='PASTEDOWN') | layout.operator("text.paste", icon='PASTEDOWN') | ||||
| layout.operator("text.duplicate_line") | |||||
| layout.separator() | layout.separator() | ||||
| layout.operator("text.duplicate_line") | |||||
| layout.operator("text.move_lines", | layout.operator("text.move_lines", | ||||
| text="Move Lines Up").direction = 'UP' | text="Move Up").direction = 'UP' | ||||
| layout.operator("text.move_lines", | layout.operator("text.move_lines", | ||||
| text="Move Lines Down").direction = 'DOWN' | text="Move Down").direction = 'DOWN' | ||||
| layout.separator() | layout.separator() | ||||
| Context not available. | |||||
| layout.separator() | layout.separator() | ||||
| layout.operator("text.comment", text="Comment") | layout.operator("text.comment_toggle", text="Toggle Comment") | ||||
| layout.operator("text.uncomment", text="Uncomment") | |||||
| layout.separator() | layout.separator() | ||||
| Context not available. | |||||
| TEXT_MT_editor_menus, | TEXT_MT_editor_menus, | ||||
| TEXT_PT_find, | TEXT_PT_find, | ||||
| TEXT_PT_properties, | TEXT_PT_properties, | ||||
| TEXT_MT_view_navigation, | |||||
| TEXT_MT_view, | TEXT_MT_view, | ||||
| TEXT_MT_text, | TEXT_MT_text, | ||||
| TEXT_MT_templates, | TEXT_MT_templates, | ||||
| TEXT_MT_templates_py, | TEXT_MT_templates_py, | ||||
| TEXT_MT_templates_osl, | TEXT_MT_templates_osl, | ||||
| TEXT_MT_edit_select, | TEXT_MT_select, | ||||
| TEXT_MT_format, | TEXT_MT_format, | ||||
| TEXT_MT_edit_to3d, | TEXT_MT_edit_to3d, | ||||
| TEXT_MT_toolbox, | TEXT_MT_toolbox, | ||||
| Context not available. | |||||
Would rather not remove this from the header, it's has significant side effects and it's something you could easily miss.