[Bf-blender-cvs] [24dfb057bdb] temp-checkbox-layout-tweaks: Add checkbox+value configuration many places where applicable

William Reynish noreply at git.blender.org
Sat Apr 11 10:56:14 CEST 2020


Commit: 24dfb057bdbdef42c09ba425a388f89b3ca8bb9a
Author: William Reynish
Date:   Sat Apr 11 10:55:18 2020 +0200
Branches: temp-checkbox-layout-tweaks
https://developer.blender.org/rB24dfb057bdbdef42c09ba425a388f89b3ca8bb9a

Add checkbox+value configuration many places where applicable

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

M	release/scripts/startup/bl_ui/properties_data_mesh.py
M	release/scripts/startup/bl_ui/properties_physics_common.py
M	release/scripts/startup/bl_ui/properties_render.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py

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

diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 300f656d2f6..d3e9546e149 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -189,28 +189,21 @@ class DATA_PT_normals(MeshButtonsPanel, Panel):
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
 
-    def draw(self, context):
-        pass
-
-
-class DATA_PT_normals_auto_smooth(MeshButtonsPanel, Panel):
-    bl_label = "Auto Smooth"
-    bl_parent_id = "DATA_PT_normals"
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
-
-    def draw_header(self, context):
-        mesh = context.mesh
-
-        self.layout.prop(mesh, "use_auto_smooth", text="")
-
     def draw(self, context):
         layout = self.layout
         layout.use_property_split = True
-
+        
         mesh = context.mesh
 
-        layout.active = mesh.use_auto_smooth and not mesh.has_custom_normals
-        layout.prop(mesh, "auto_smooth_angle", text="Angle")
+        col = layout.column(align=False, heading="Auto Smooth")
+        col.use_property_decorate = False
+        row = col.row(align=True)
+        sub = row.row(align=True)
+        sub.prop(mesh, "use_auto_smooth", text="")
+        sub = sub.row(align=True)
+        sub.active = mesh.use_auto_smooth and not mesh.has_custom_normals
+        sub.prop(mesh, "auto_smooth_angle", text="")
+        row.prop_decorator(mesh, "auto_smooth_angle")
 
 
 class DATA_PT_texture_space(MeshButtonsPanel, Panel):
@@ -546,7 +539,6 @@ classes = (
     DATA_PT_vertex_colors,
     DATA_PT_face_maps,
     DATA_PT_normals,
-    DATA_PT_normals_auto_smooth,
     DATA_PT_texture_space,
     DATA_PT_remesh,
     DATA_PT_customdata,
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index 45845bd155b..8ac218ac05b 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -338,26 +338,29 @@ def basic_force_field_falloff_ui(self, field):
     if not field or field.type == 'NONE':
         return
 
-    flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
-
-    col = flow.column()
+    col = layout.column()
     col.prop(field, "z_direction")
     col.prop(field, "falloff_power", text="Power")
 
-    col = flow.column()
-    col.prop(field, "use_min_distance", text="Use Minimum")
-
-    sub = col.column(align=True)
+    col = layout.column(align=False, heading="Minimum Distance")
+    col.use_property_decorate = False
+    row = col.row(align=True)
+    sub = row.row(align=True)
+    sub.prop(field, "use_min_distance", text="")
+    sub = sub.row(align=True)
     sub.active = field.use_min_distance
-    sub.prop(field, "distance_min", text="Min Distance")
-
-    col = flow.column()
-    col.prop(field, "use_max_distance", text="Use Maximum")
-
-    sub = col.column(align=True)
+    sub.prop(field, "distance_min", text="")
+    row.prop_decorator(field, "distance_min")
+
+    col = layout.column(align=False, heading="Maximum Distance")
+    col.use_property_decorate = False
+    row = col.row(align=True)
+    sub = row.row(align=True)
+    sub.prop(field, "use_max_distance", text="")
+    sub = sub.row(align=True)
     sub.active = field.use_max_distance
-    sub.prop(field, "distance_max", text="Max Distance")
-
+    sub.prop(field, "distance_max", text="")
+    row.prop_decorator(field, "distance_max")
 
 classes = (
     PHYSICS_PT_add,
diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index fd4859f3620..2d13aed617c 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -475,33 +475,21 @@ class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
 
         scene = context.scene
         rd = scene.render
+        props = scene.eevee
 
         col = layout.column()
         col.prop(rd, "filter_size")
         col.prop(rd, "film_transparent", text="Transparent")
 
-
-class RENDER_PT_eevee_film_overscan(RenderButtonsPanel, Panel):
-    bl_label = "Overscan"
-    bl_parent_id = "RENDER_PT_eevee_film"
-    bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_EEVEE'}
-
-    def draw_header(self, context):
-
-        scene = context.scene
-        props = scene.eevee
-
-        self.layout.prop(props, "use_overscan", text="")
-
-    def draw(self, context):
-        layout = self.layout
-        layout.use_property_split = True
-        scene = context.scene
-        props = scene.eevee
-
-        layout.active = props.use_overscan
-        layout.prop(props, "overscan_size", text="Size")
+        col = layout.column(align=False, heading="Overscan")
+        col.use_property_decorate = False
+        row = col.row(align=True)
+        sub = row.row(align=True)
+        sub.prop(props, "use_overscan", text="")
+        sub = sub.row(align=True)
+        sub.active = props.use_overscan
+        sub.prop(props, "overscan_size", text="")
+        row.prop_decorator(props, "overscan_size")
 
 
 class RENDER_PT_eevee_hair(RenderButtonsPanel, Panel):
@@ -696,7 +684,6 @@ classes = (
     RENDER_PT_eevee_indirect_lighting,
     RENDER_PT_eevee_indirect_lighting_display,
     RENDER_PT_eevee_film,
-    RENDER_PT_eevee_film_overscan,
     RENDER_PT_opengl_sampling,
     RENDER_PT_opengl_lighting,
     RENDER_PT_opengl_color,
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 167091815b4..f62ff655095 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -5392,8 +5392,8 @@ class VIEW3D_PT_view3d_properties(Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False  # No animation.
 
-        flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
-        col = flow.column()
+
+        col = layout.column()
 
         subcol = col.column()
         subcol.active = bool(view.region_3d.view_perspective != 'CAMERA' or view.region_quadviews)
@@ -5405,14 +5405,16 @@ class VIEW3D_PT_view3d_properties(Panel):
 
         subcol.separator()
 
-        col = flow.column()
-
-        subcol = col.column()
-        subcol.prop(view, "use_local_camera")
+        col = layout.column()
 
-        subcol = col.column()
-        subcol.enabled = view.use_local_camera
-        subcol.prop(view, "camera", text="Local Camera")
+        col = layout.column(align=False, heading="Local Camera")
+        col.use_property_decorate = False
+        row = col.row(align=True)
+        sub = row.row(align=True)
+        sub.prop(view, "use_local_camera", text="")
+        sub = sub.row(align=True)
+        sub.enabled = view.use_local_camera
+        sub.prop(view, "camera", text="")
 
         subcol = col.column(align=True)
         subcol.prop(view, "use_render_border")
@@ -5435,23 +5437,24 @@ class VIEW3D_PT_view3d_lock(Panel):
         view = context.space_data
 
         col = layout.column(align=True)
-        subcol = col.column()
-        subcol.active = bool(view.region_3d.view_perspective != 'CAMERA' or view.region_quadviews)
+        sub = col.column()
+        sub.active = bool(view.region_3d.view_perspective != 'CAMERA' or view.region_quadviews)
 
-        subcol.prop(view, "lock_object")
+        sub.prop(view, "lock_object")
         lock_object = view.lock_object
         if lock_object:
             if lock_object.type == 'ARMATURE':
-                subcol.prop_search(
+                sub.prop_search(
                     view, "lock_bone", lock_object.data,
                     "edit_bones" if lock_object.mode == 'EDIT'
                     else "bones",
                     text="",
                 )
         else:
-            subcol.prop(view, "lock_cursor", text="Lock to 3D Cursor")
+            subcol = sub.column(heading = "Lock")
+            subcol.prop(view, "lock_cursor", text="To 3D Cursor")
 
-        col.prop(view, "lock_camera")
+        col.prop(view, "lock_camera", text="Camera to View")
 
 
 class VIEW3D_PT_view3d_cursor(Panel):
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 993b0038529..81838ca12cf 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -957,18 +957,13 @@ class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
 
         sculpt = context.tool_settings.sculpt
 
-        split = layout.split()
-
-        col = split.column()
-        col.alignment = 'RIGHT'
-        col.label(text="Mirror")
-
-        col = split.column()
-
+        col = layout.column(align=False, heading = "Mirror")
+        col.use_property_decorate = False
         row = col.row(align=True)
-        row.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
-        row.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
-        row.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
+        sub = row.row(align=True)
+        sub.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
+        sub.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
+        sub.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
 
         split = layout.split()



More information about the Bf-blender-cvs mailing list