From 65b03129041f42dabe1cdfd5154fc6efa6e1e758 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Apr 2019 12:23:07 +0200 Subject: 3D View: move gizmo draw options out of overlays Gizmo's now have their own popover in preparation for making transform gizmos accessible without having to use tools See: T63518 --- release/scripts/startup/bl_ui/space_view3d.py | 55 +++++++++++++++------------ 1 file changed, 30 insertions(+), 25 deletions(-) (limited to 'release/scripts') diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 950dcc71c41..36fc0a38fcb 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -132,6 +132,17 @@ class VIEW3D_HT_header(Header): # Mode & Transform Settings scene = context.scene + # Gizmo popover. + row = layout.row(align=True) + # FIXME: place-holder icon. + row.prop(view, "show_gizmo", text="", toggle=True, icon='EMPTY_DATA') + sub = row.row(align=True) + sub.active = view.show_gizmo + sub.popover( + panel="VIEW3D_PT_gizmo_display", + text="", + ) + # Orientation if object_mode in {'OBJECT', 'EDIT', 'EDIT_GPENCIL'} or has_pose_mode: orient_slot = scene.transform_orientation_slots[0] @@ -4756,42 +4767,36 @@ class VIEW3D_PT_shading_options_ssao(Panel): col.prop(scene.display, "matcap_ssao_attenuation") -class VIEW3D_PT_overlay(Panel): +class VIEW3D_PT_gizmo_display(Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'HEADER' - bl_label = "Overlays" - bl_ui_units_x = 13 - - def draw(self, context): - layout = self.layout - layout.label(text="Viewport Overlays") - - -class VIEW3D_PT_overlay_gizmo(Panel): - bl_space_type = 'VIEW_3D' - bl_region_type = 'HEADER' - bl_parent_id = 'VIEW3D_PT_overlay' bl_label = "Gizmo" - def draw_header(self, context): - view = context.space_data - self.layout.prop(view, "show_gizmo", text="") - def draw(self, context): layout = self.layout view = context.space_data overlay = view.overlay - display_all = overlay.show_overlays col = layout.column() - col.active = display_all + col.label(text="Viewport Gizmos") - row = col.row(align=True) - row.active = view.show_gizmo - row.prop(view, "show_gizmo_navigate", text="Navigate", toggle=True) - row.prop(view, "show_gizmo_context", text="Active Object", toggle=True) - row.prop(view, "show_gizmo_tool", text="Active Tools", toggle=True) + col.active = view.show_gizmo + colsub = col.column() + colsub.prop(view, "show_gizmo_navigate", text="Navigate") + colsub.prop(view, "show_gizmo_context", text="Active Object") + colsub.prop(view, "show_gizmo_tool", text="Active Tools") + + +class VIEW3D_PT_overlay(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'HEADER' + bl_label = "Overlays" + bl_ui_units_x = 13 + + def draw(self, context): + layout = self.layout + layout.label(text="Viewport Overlays") class VIEW3D_PT_overlay_guides(Panel): @@ -6045,8 +6050,8 @@ classes = ( VIEW3D_PT_shading_options, VIEW3D_PT_shading_options_shadow, VIEW3D_PT_shading_options_ssao, + VIEW3D_PT_gizmo_display, VIEW3D_PT_overlay, - VIEW3D_PT_overlay_gizmo, VIEW3D_PT_overlay_guides, VIEW3D_PT_overlay_object, VIEW3D_PT_overlay_geometry, -- cgit v1.2.3