Cleanup: Toggle X-Ray button, removed nested ternary operators
Replaced two nested ternary operators combined with dynamic attribute access, with a simple `if`/`elif`/`else` construct. No functional changes.
This commit is contained in:
@@ -829,18 +829,17 @@ class VIEW3D_HT_header(Header):
|
|||||||
|
|
||||||
# While exposing 'shading.show_xray(_wireframe)' is correct.
|
# While exposing 'shading.show_xray(_wireframe)' is correct.
|
||||||
# this hides the key shortcut from users: T70433.
|
# this hides the key shortcut from users: T70433.
|
||||||
|
if has_pose_mode:
|
||||||
|
draw_depressed = overlay.show_xray_bone
|
||||||
|
elif shading.type == 'WIREFRAME':
|
||||||
|
draw_depressed = shading.show_xray_wireframe
|
||||||
|
else:
|
||||||
|
draw_depressed = shading.show_xray
|
||||||
row.operator(
|
row.operator(
|
||||||
"view3d.toggle_xray",
|
"view3d.toggle_xray",
|
||||||
text="",
|
text="",
|
||||||
icon='XRAY',
|
icon='XRAY',
|
||||||
depress=(
|
depress=draw_depressed,
|
||||||
overlay.show_xray_bone if has_pose_mode else
|
|
||||||
getattr(
|
|
||||||
shading,
|
|
||||||
"show_xray_wireframe" if shading.type == 'WIREFRAME' else
|
|
||||||
"show_xray"
|
|
||||||
)
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user