Cleanup: inline icon conditional

This commit is contained in:
Campbell Barton
2018-08-30 13:47:27 +10:00
parent e9c2477a84
commit 2093b79ee7
5 changed files with 67 additions and 34 deletions

View File

@@ -289,10 +289,13 @@ class DATA_PT_camera_background_image(CameraButtonsPanel, Panel):
else:
row.label(text="Not Set")
if bg.show_background_image:
row.prop(bg, "show_background_image", text="", emboss=False, icon='RESTRICT_VIEW_OFF')
else:
row.prop(bg, "show_background_image", text="", emboss=False, icon='RESTRICT_VIEW_ON')
row.prop(
bg,
"show_background_image",
text="",
emboss=False,
icon='RESTRICT_VIEW_OFF' if bg.show_background_image else 'RESTRICT_VIEW_ON',
)
row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i