Fix T58794: extended shading pie menu wrong order in lookdev mode.
[blender.git] / release / scripts / startup / bl_ui / space_view3d.py
index ccacff009922cd09eed0b36e7833eda0d0d73ed0..e0f72e810968511b933a47596cab756743ca5b69 100644 (file)
@@ -3888,41 +3888,28 @@ class VIEW3D_MT_shading_ex_pie(Menu):
         pie.prop_enum(view.shading, "type", value='WIREFRAME')
         pie.prop_enum(view.shading, "type", value='SOLID')
 
-        xray_active = (
-            (context.mode in {'POSE', 'EDIT_MESH'}) or
-            (view.shading.type in {'SOLID', 'WIREFRAME'})
-        )
-        if xray_active:
-            sub = pie
-        else:
-            sub = pie.row()
-            sub.active = False
-
-        if False:
-            sub.operator("view3d.toggle_xray", text="Toggle X-Ray", icon='XRAY')
+        # Note this duplicates 'view3d.toggle_xray' logic, so we can see the active item: T58661.
+        if (
+                (context.mode == 'POSE') or
+                ((context.mode == 'WEIGHT_PAINT') and (context.active_object.find_armature()))
+        ):
+            pie.prop(view.overlay, "show_xray_bone", icon='XRAY')
         else:
-            # XXX, duplicate 'view3d.toggle_xray' logic, so we can see the active item: T58661.
-            if (
-                    (context.mode == 'POSE') or
-                    ((context.mode == 'WEIGHT_PAINT') and (context.active_object.find_armature()))
-            ):
-                pie.prop(view.overlay, "show_bone_select", icon='XRAY')
+            xray_active = (
+                (context.mode == 'EDIT_MESH') or
+                (view.shading.type in {'SOLID', 'WIREFRAME'})
+            )
+            if xray_active:
+                sub = pie
             else:
-                xray_active = (
-                    (context.mode == '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_wireframe" if (view.shading.type == 'WIREFRAME') else "show_xray",
-                    text="Toggle X-Ray",
-                    icon='XRAY',
-                )
+                sub = pie.row()
+                sub.active = False
+            sub.prop(
+                view.shading,
+                "show_xray_wireframe" if (view.shading.type == 'WIREFRAME') else "show_xray",
+                text="Toggle X-Ray",
+                icon='XRAY',
+            )
 
         pie.prop(view.overlay, "show_overlays", text="Toggle Overlays", icon='OVERLAY')