diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-21 18:01:10 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-21 18:01:10 +0300 |
commit | d2a491da5f88d0a823d0aa6e01b9c29a9b055612 (patch) | |
tree | 97fa0f13894edab6fe2018e7e74b4c6e163c054c | |
parent | 202baaaa169fbd21f5b3680681bdb02b2a6e5c19 (diff) |
Viewport: tweak shading pie menu to have X-ray on same side as wireframe.
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index e6012f5d0b7..068276f44c6 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -3797,18 +3797,27 @@ class VIEW3D_MT_shading_pie(Menu): def draw(self, context): layout = self.layout + pie = layout.menu_pie() view = context.space_data - pie = layout.menu_pie() pie.prop(view.shading, "type", expand=True) - pie.prop(view.overlay, "show_overlays", icon='OVERLAY') + if context.mode == 'POSE': pie.prop(view.overlay, "show_bone_select", icon='ORTHO') - elif context.mode == 'EDIT_MESH': - pie.prop(view.shading, "show_xray", icon='ORTHO') - elif view.shading.type in {'SOLID', 'WIREFRAME'}: - pie.prop(view.shading, "show_xray", icon='ORTHO') + else: + xray_active = (context.mode in 'EDIT_MESH') or \ + (view.shading.type in {'SOLID', 'WIREFRAME'}) + + if xray_active: + sub = pie + else: + sub = pie.row() + sub.active = False + + sub.prop(view.shading, "show_xray", icon='ORTHO') + + pie.prop(view.overlay, "show_overlays", icon='OVERLAY') # ********** Panel ********** |