UI: Improve Studio Lights Editor layout

Improve the Studio Lights Editor Preferences panel by replacing the
current column layout (which looks very horizontally compressed using
the default Preferences window size) by a grid flow layout with boxes.

Pull Request: https://projects.blender.org/blender/blender/pulls/132425
This commit is contained in:
Jonas Holzman
2024-12-30 00:40:07 +01:00
parent de3accb68a
commit f6bbcaba6d

View File

@@ -2733,15 +2733,17 @@ class USERPREF_PT_studiolight_light_editor(StudioLightPanel, Panel):
@staticmethod
def opengl_light_buttons(layout, light):
col = layout.column()
col.active = light.use
box = col.box()
box.active = light.use
col.prop(light, "use", text="Use Light")
col.prop(light, "diffuse_color", text="Diffuse")
col.prop(light, "specular_color", text="Specular")
col.prop(light, "smooth")
col.prop(light, "direction")
box.prop(light, "use", text="Use Light")
box.prop(light, "diffuse_color", text="Diffuse")
box.prop(light, "specular_color", text="Specular")
box.prop(light, "smooth")
box.prop(light, "direction")
col.separator()
def draw(self, context):
layout = self.layout
@@ -2756,25 +2758,12 @@ class USERPREF_PT_studiolight_light_editor(StudioLightPanel, Panel):
layout.separator()
layout.use_property_split = True
column = layout.split()
column.active = system.use_studio_light_edit
light = system.solid_lights[0]
colsplit = column.split(factor=0.85)
self.opengl_light_buttons(colsplit, light)
flow = layout.grid_flow(row_major=True, columns=2, even_rows=True, even_columns=True)
flow.active = system.use_studio_light_edit
light = system.solid_lights[1]
colsplit = column.split(factor=0.85)
self.opengl_light_buttons(colsplit, light)
light = system.solid_lights[2]
colsplit = column.split(factor=0.85)
self.opengl_light_buttons(colsplit, light)
light = system.solid_lights[3]
self.opengl_light_buttons(column, light)
layout.separator()
for i, light in enumerate(system.solid_lights):
self.opengl_light_buttons(flow, light)
layout.prop(system, "light_ambient")