Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_text.py
| # SPDX-License-Identifier: GPL-2.0-or-later | # SPDX-License-Identifier: GPL-2.0-or-later | ||||
| import bpy | import bpy | ||||
| from bpy.types import Header, Menu, Panel | from bpy.types import Header, Menu, Panel | ||||
| from bpy.app.translations import pgettext_iface as iface_ | from bpy.app.translations import ( | ||||
| contexts as i18n_contexts, | |||||
| pgettext_iface as iface_, | |||||
| ) | |||||
| class TEXT_HT_header(Header): | class TEXT_HT_header(Header): | ||||
| bl_space_type = 'TEXT_EDITOR' | bl_space_type = 'TEXT_EDITOR' | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| layout.separator() | layout.separator() | ||||
| # settings | # settings | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| if not st.text: | if not st.text: | ||||
| row.active = False | row.active = False | ||||
| row.prop(st, "use_match_case", text="Case", toggle=True) | row.prop(st, "use_match_case", text="Case", toggle=True) | ||||
| row.prop(st, "use_find_wrap", text="Wrap", toggle=True) | row.prop(st, "use_find_wrap", text="Wrap", | ||||
| text_ctxt=i18n_contexts.id_text, toggle=True) | |||||
| 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): | class TEXT_MT_view_navigation(Menu): | ||||
| bl_label = "Navigation" | bl_label = "Navigation" | ||||
| def draw(self, _context): | def draw(self, _context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | class TEXT_MT_text(Menu): | ||||
| bl_label = "Text" | bl_label = "Text" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| st = context.space_data | st = context.space_data | ||||
| text = st.text | text = st.text | ||||
| layout.operator("text.new", text="New", icon='FILE_NEW') | layout.operator("text.new", text="New", | ||||
| text_ctxt=i18n_contexts.id_text, 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() | ||||
| layout.operator("text.reload") | layout.operator("text.reload") | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("text.save", icon='FILE_TICK') | layout.operator("text.save", icon='FILE_TICK') | ||||
| ▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines | |||||