UI: move toggle icons out of layout checks into rna
This commit is contained in:
@@ -253,7 +253,7 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
|
||||
active = pchan.is_in_ik_chain
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
split.prop(pchan, "lock_ik_x", icon='LOCKED' if pchan.lock_ik_x else 'UNLOCKED', text="X")
|
||||
split.prop(pchan, "lock_ik_x", text="X", icon_only=True)
|
||||
split.active = active
|
||||
row = split.row()
|
||||
row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
|
||||
@@ -270,7 +270,7 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
|
||||
sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and active
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
split.prop(pchan, "lock_ik_y", icon='LOCKED' if pchan.lock_ik_y else 'UNLOCKED', text="Y")
|
||||
split.prop(pchan, "lock_ik_y", text="Y", icon_only=True)
|
||||
split.active = active
|
||||
row = split.row()
|
||||
row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
|
||||
@@ -288,7 +288,7 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
|
||||
sub.active = pchan.lock_ik_y is False and pchan.use_ik_limit_y and active
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
split.prop(pchan, "lock_ik_z", icon='LOCKED' if pchan.lock_ik_z else 'UNLOCKED', text="Z")
|
||||
split.prop(pchan, "lock_ik_z", text="Z", icon_only=True)
|
||||
split.active = active
|
||||
sub = split.row()
|
||||
sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
|
||||
|
||||
@@ -74,11 +74,7 @@ class RENDER_PT_render(RenderButtonsPanel, Panel):
|
||||
split.label(text="Display:")
|
||||
row = split.row(align=True)
|
||||
row.prop(rd, "display_mode", text="")
|
||||
|
||||
if rd.use_lock_interface:
|
||||
row.prop(rd, "use_lock_interface", text="", icon='LOCKED')
|
||||
else:
|
||||
row.prop(rd, "use_lock_interface", text="", icon='UNLOCKED')
|
||||
row.prop(rd, "use_lock_interface", icon_only=True)
|
||||
|
||||
|
||||
class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
|
||||
@@ -874,11 +874,10 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel):
|
||||
col.separator()
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop(brush, "use_relative_jitter", icon_only=True)
|
||||
if brush.use_relative_jitter:
|
||||
row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
|
||||
row.prop(brush, "jitter", slider=True)
|
||||
else:
|
||||
row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
|
||||
row.prop(brush, "jitter_absolute")
|
||||
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
|
||||
|
||||
|
||||
@@ -427,12 +427,12 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
|
||||
sub = row.row(align=True)
|
||||
sub.active = (not strip.mute)
|
||||
sub.prop(strip, "blend_alpha", text="Opacity", slider=True)
|
||||
row.prop(strip, "mute", toggle=True, icon='RESTRICT_VIEW_ON' if strip.mute else 'RESTRICT_VIEW_OFF', text="")
|
||||
row.prop(strip, "lock", toggle=True, icon='LOCKED' if strip.lock else 'UNLOCKED', text="")
|
||||
row.prop(strip, "mute", toggle=True, icon_only=True)
|
||||
row.prop(strip, "lock", toggle=True, icon_only=True)
|
||||
else:
|
||||
row = layout.row(align=True)
|
||||
row.prop(strip, "mute", toggle=True, icon='RESTRICT_VIEW_ON' if strip.mute else 'RESTRICT_VIEW_OFF')
|
||||
row.prop(strip, "lock", toggle=True, icon='LOCKED' if strip.lock else 'UNLOCKED')
|
||||
row.prop(strip, "mute", toggle=True, icon_only=True)
|
||||
row.prop(strip, "lock", toggle=True, icon_only=True)
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
|
||||
@@ -738,10 +738,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
|
||||
row = col.row(align=True)
|
||||
|
||||
if capabilities.has_space_attenuation:
|
||||
if brush.use_space_attenuation:
|
||||
row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='LOCKED')
|
||||
else:
|
||||
row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='UNLOCKED')
|
||||
row.prop(brush, "use_space_attenuation", toggle=True, icon_only=True)
|
||||
|
||||
self.prop_unified_strength(row, context, brush, "strength", text="Strength")
|
||||
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
|
||||
@@ -771,10 +768,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
|
||||
col.separator()
|
||||
row = col.row(align=True)
|
||||
|
||||
if brush.use_original_normal:
|
||||
row.prop(brush, "use_original_normal", toggle=True, text="", icon='LOCKED')
|
||||
else:
|
||||
row.prop(brush, "use_original_normal", toggle=True, text="", icon='UNLOCKED')
|
||||
row.prop(brush, "use_original_normal", toggle=True, icon_only=True)
|
||||
|
||||
row.prop(brush, "sculpt_plane", text="")
|
||||
|
||||
@@ -1061,11 +1055,10 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
|
||||
col.separator()
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop(brush, "use_relative_jitter", icon_only=True)
|
||||
if brush.use_relative_jitter:
|
||||
row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
|
||||
row.prop(brush, "jitter", slider=True)
|
||||
else:
|
||||
row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
|
||||
row.prop(brush, "jitter_absolute")
|
||||
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
|
||||
|
||||
@@ -1083,11 +1076,10 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
|
||||
col.separator()
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop(brush, "use_relative_jitter", icon_only=True)
|
||||
if brush.use_relative_jitter:
|
||||
row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
|
||||
row.prop(brush, "jitter", slider=True)
|
||||
else:
|
||||
row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
|
||||
row.prop(brush, "jitter_absolute")
|
||||
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user