Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_topbar.py
| Show First 20 Lines • Show All 593 Lines • ▼ Show 20 Lines | def draw(self, _context): | ||||
| # For key binding discoverability. | # For key binding discoverability. | ||||
| props = layout.operator("screen.workspace_cycle", text="Previous Workspace") | props = layout.operator("screen.workspace_cycle", text="Previous Workspace") | ||||
| props.direction = 'PREV' | props.direction = 'PREV' | ||||
| props = layout.operator("screen.workspace_cycle", text="Next Workspace") | props = layout.operator("screen.workspace_cycle", text="Next Workspace") | ||||
| props.direction = 'NEXT' | props.direction = 'NEXT' | ||||
| class TOPBAR_PT_active_tool(Panel): | |||||
| bl_space_type = 'PROPERTIES' | |||||
| bl_region_type = 'WINDOW' | |||||
| bl_category = "" | |||||
| bl_context = ".active_tool" # dot on purpose (access from tool settings) | |||||
| bl_label = "Active Tool" | |||||
| bl_options = {'HIDE_HEADER'} | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| # Panel display of topbar tool settings. | |||||
| # currently displays in tool settings, keep here since the same functionality is used for the topbar. | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| from .space_toolsystem_common import ToolSelectPanelHelper | |||||
| ToolSelectPanelHelper.draw_active_tool_header(context, layout, show_tool_name=True) | |||||
| # Grease Pencil Object - Primitive curve | # Grease Pencil Object - Primitive curve | ||||
| class TOPBAR_PT_gpencil_primitive(Panel): | class TOPBAR_PT_gpencil_primitive(Panel): | ||||
| bl_space_type = 'VIEW_3D' | bl_space_type = 'VIEW_3D' | ||||
| bl_region_type = 'HEADER' | bl_region_type = 'HEADER' | ||||
| bl_label = "Primitives" | bl_label = "Primitives" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| settings = context.tool_settings.gpencil_sculpt | settings = context.tool_settings.gpencil_sculpt | ||||
| ▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | classes = ( | ||||
| TOPBAR_MT_file_import, | TOPBAR_MT_file_import, | ||||
| TOPBAR_MT_file_export, | TOPBAR_MT_file_export, | ||||
| TOPBAR_MT_file_external_data, | TOPBAR_MT_file_external_data, | ||||
| TOPBAR_MT_file_previews, | TOPBAR_MT_file_previews, | ||||
| TOPBAR_MT_edit, | TOPBAR_MT_edit, | ||||
| TOPBAR_MT_render, | TOPBAR_MT_render, | ||||
| TOPBAR_MT_window, | TOPBAR_MT_window, | ||||
| TOPBAR_MT_help, | TOPBAR_MT_help, | ||||
| TOPBAR_PT_active_tool, | |||||
| TOPBAR_PT_gpencil_layers, | TOPBAR_PT_gpencil_layers, | ||||
| TOPBAR_PT_gpencil_primitive, | TOPBAR_PT_gpencil_primitive, | ||||
| TOPBAR_PT_gpencil_fill, | TOPBAR_PT_gpencil_fill, | ||||
| TOPBAR_PT_name, | TOPBAR_PT_name, | ||||
| ) | ) | ||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| from bpy.utils import register_class | from bpy.utils import register_class | ||||
| for cls in classes: | for cls in classes: | ||||
| register_class(cls) | register_class(cls) | ||||