Fix T70433: No shortcut in tooltip for viewport X-Ray
While not a bug exactly, it's useful to show the shortcut, expose the operator in the UI instead of the property.
This commit is contained in:
@@ -707,10 +707,18 @@ class VIEW3D_HT_header(Header):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.active = (object_mode == 'EDIT') or (shading.type in {'WIREFRAME', 'SOLID'})
|
row.active = (object_mode == 'EDIT') or (shading.type in {'WIREFRAME', 'SOLID'})
|
||||||
|
|
||||||
if shading.type == 'WIREFRAME':
|
# While exposing 'shading.show_xray(_wireframe)' is correct.
|
||||||
row.prop(shading, "show_xray_wireframe", text="", icon='XRAY')
|
# this hides the key shortcut from users: T70433.
|
||||||
else:
|
row.operator(
|
||||||
row.prop(shading, "show_xray", text="", icon='XRAY')
|
"view3d.toggle_xray",
|
||||||
|
text="",
|
||||||
|
icon='XRAY',
|
||||||
|
depress=getattr(
|
||||||
|
shading,
|
||||||
|
"show_xray_wireframe" if shading.type == 'WIREFRAME' else
|
||||||
|
"show_xray"
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(shading, "type", text="", expand=True)
|
row.prop(shading, "type", text="", expand=True)
|
||||||
|
Reference in New Issue
Block a user