diff options
author | Vuk Gardašević <lijenstina> | 2018-07-02 19:43:30 +0300 |
---|---|---|
committer | Pablo Vazquez <venomgfx@gmail.com> | 2018-07-02 19:44:05 +0300 |
commit | 12603826eac9bd7399e065987d3c583e2734b0a7 (patch) | |
tree | 19203561c550546344b670f8c6ac3ef1e66d1581 /release/scripts/startup/bl_ui/space_topbar.py | |
parent | 9f80429ab6a83a37ad94cbeee7f6ede4dec84f1a (diff) |
UI: Transform Orientations panel as popover
Functionality fits in the Transform Orientations, no need for a dedicated
panel in the viewport sidebar.
See D3511
Diffstat (limited to 'release/scripts/startup/bl_ui/space_topbar.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 84fb386efd5..52d180c36b0 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -270,6 +270,34 @@ class TOPBAR_PT_snapping(Panel): col.prop(toolsettings, "use_snap_peel_object") +class TOPBAR_PT_transform_orientations(Panel): + bl_space_type = 'TOPBAR' + bl_region_type = 'HEADER' + bl_label = "Transform Orientations" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + view = context.space_data + return (view) + + def draw(self, context): + layout = self.layout + layout.label("Tranform Orientations") + + scene = context.scene + orientation = scene.current_orientation + + col = layout.split(percentage=0.9) + col.prop(scene, "transform_orientation", expand=True) + col.operator("transform.create_orientation", text="", icon='ZOOMIN', emboss=False) + + if orientation: + row = layout.row(align=False) + row.prop(orientation, "name", text="") + row.operator("transform.delete_orientation", text="", icon='X', emboss=False) + + class INFO_MT_editor_menus(Menu): bl_idname = "INFO_MT_editor_menus" bl_label = "" @@ -629,6 +657,7 @@ classes = ( TOPBAR_HT_lower_bar, TOPBAR_PT_pivot_point, TOPBAR_PT_snapping, + TOPBAR_PT_transform_orientations, TOPBAR_MT_file_specials, TOPBAR_MT_window_specials, INFO_MT_editor_menus, |