[Bf-blender-cvs] [e392e033543] blender2.8: UI: Layout tweaks to Studio Lights panel in Preferences.

Pablo Vazquez noreply at git.blender.org
Wed Nov 28 16:25:01 CET 2018


Commit: e392e0335431346eebd3d1e7cc330cd6845bdeb3
Author: Pablo Vazquez
Date:   Wed Nov 28 16:24:55 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBe392e0335431346eebd3d1e7cc330cd6845bdeb3

UI: Layout tweaks to Studio Lights panel in Preferences.

Move Studio Lights panel first, and use single-column layout.

===================================================================

M	release/scripts/startup/bl_ui/space_userpref.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 8ace0b8164e..4d961ef347a 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -1540,31 +1540,27 @@ class USERPREF_PT_studiolight_lights(Panel, StudioLightPanelMixin):
         userpref = context.user_preferences
         return (userpref.active_section == 'LIGHTS')
 
-    def opengl_light_buttons(self, column, light):
-        split = column.split()
+    def opengl_light_buttons(self, layout, light):
 
-        col = split.column()
-        col.prop(light, "use", text="Use", icon='OUTLINER_OB_LIGHT' if light.use else 'LIGHT_DATA')
+        col = layout.column()
+        col.active = light.use
 
-        sub = col.column()
-        sub.active = light.use
-        sub.prop(light, "diffuse_color")
-        sub.prop(light, "specular_color")
-        sub.prop(light, "smooth")
+        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")
 
-        col = split.column()
-        col.active = light.use
-        col.prop(light, "direction", text="")
 
     def draw(self, context):
         layout = self.layout
+
+        layout.use_property_split = True
         column = layout.split()
 
         userpref = context.user_preferences
         system = userpref.system
 
-        layout.prop(system, "light_ambient")
-
         light = system.solid_lights[0]
         colsplit = column.split(factor=0.85)
         self.opengl_light_buttons(colsplit, light)
@@ -1576,6 +1572,10 @@ class USERPREF_PT_studiolight_lights(Panel, StudioLightPanelMixin):
         light = system.solid_lights[2]
         self.opengl_light_buttons(column, light)
 
+        layout.separator()
+
+        layout.prop(system, "light_ambient")
+
 classes = (
     USERPREF_HT_header,
     USERPREF_PT_navigation,
@@ -1590,10 +1590,10 @@ classes = (
     USERPREF_PT_input,
     USERPREF_MT_addons_online_resources,
     USERPREF_PT_addons,
+    USERPREF_PT_studiolight_lights,
     USERPREF_PT_studiolight_matcaps,
     USERPREF_PT_studiolight_world,
     USERPREF_PT_studiolight_camera,
-    USERPREF_PT_studiolight_lights,
 )
 
 if __name__ == "__main__":  # only for live edit.



More information about the Bf-blender-cvs mailing list