UI: Single-column layout for Lamp panel

This commit is contained in:
William Reynish
2018-06-27 14:23:17 +02:00
committed by Pablo Vazquez
parent 20b8e1d8f1
commit d48600fddc

View File

@@ -1126,31 +1126,30 @@ class CYCLES_LAMP_PT_lamp(CyclesButtonsPanel, Panel):
layout.prop(lamp, "type", expand=True) layout.prop(lamp, "type", expand=True)
split = layout.split() layout.use_property_split = True
col = split.column(align=True)
col = layout.column()
if lamp.type in {'POINT', 'SUN', 'SPOT'}: if lamp.type in {'POINT', 'SUN', 'SPOT'}:
col.prop(lamp, "shadow_soft_size", text="Size") col.prop(lamp, "shadow_soft_size", text="Size")
elif lamp.type == 'AREA': elif lamp.type == 'AREA':
col.prop(lamp, "shape", text="") col.prop(lamp, "shape", text="Shape")
sub = col.column(align=True) sub = col.column(align=True)
if lamp.shape in {'SQUARE', 'DISK'}: if lamp.shape in {'SQUARE', 'DISK'}:
sub.prop(lamp, "size") sub.prop(lamp, "size")
elif lamp.shape in {'RECTANGLE', 'ELLIPSE'}: elif lamp.shape in {'RECTANGLE', 'ELLIPSE'}:
sub.prop(lamp, "size", text="Size X") sub.prop(lamp, "size", text="Size X")
sub.prop(lamp, "size_y", text="Size Y") sub.prop(lamp, "size_y", text="Y")
if not (lamp.type == 'AREA' and clamp.is_portal): if not (lamp.type == 'AREA' and clamp.is_portal):
sub = col.column(align=True) sub = col.column()
if use_branched_path(context): if use_branched_path(context):
subsub = sub.row(align=True) subsub = sub.row(align=True)
subsub.active = use_sample_all_lights(context) subsub.active = use_sample_all_lights(context)
subsub.prop(clamp, "samples") subsub.prop(clamp, "samples")
sub.prop(clamp, "max_bounces") sub.prop(clamp, "max_bounces")
col = split.column()
sub = col.column(align=True) sub = col.column(align=True)
sub.active = not (lamp.type == 'AREA' and clamp.is_portal) sub.active = not (lamp.type == 'AREA' and clamp.is_portal)
sub.prop(clamp, "cast_shadow") sub.prop(clamp, "cast_shadow")
@@ -1192,17 +1191,12 @@ class CYCLES_LAMP_PT_spot(CyclesButtonsPanel, Panel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
lamp = context.lamp lamp = context.lamp
layout.use_property_split = True
split = layout.split() col = layout.column()
col.prop(lamp, "spot_size", text="Size")
col = split.column() col.prop(lamp, "spot_blend", text="Blend", slider=True)
sub = col.column()
sub.prop(lamp, "spot_size", text="Size")
sub.prop(lamp, "spot_blend", text="Blend", slider=True)
col = split.column()
col.prop(lamp, "show_cone") col.prop(lamp, "show_cone")