Cleanup: use RNA icon instead of passing as an arg
authorCampbell Barton <ideasman42@gmail.com>
Wed, 2 Jan 2019 06:23:57 +0000 (17:23 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 2 Jan 2019 06:24:24 +0000 (17:24 +1100)
release/scripts/startup/bl_ui/properties_paint_common.py
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_scene.c

index f36e561..51db0a9 100644 (file)
@@ -356,15 +356,15 @@ def brush_basic_sculpt_settings(layout, context, brush, *, compact=False):
     capabilities = brush.sculpt_capabilities
 
     row = layout.row(align=True)
+    UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_locked_size")
+
     ups = tool_settings.unified_paint_settings
     if (
             (ups.use_unified_size and ups.use_locked_size) or
             ((not ups.use_unified_size) and brush.use_locked_size)
     ):
-        UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
         UnifiedPaintPanel.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius")
     else:
-        UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_locked_size", icon='UNLOCKED')
         UnifiedPaintPanel.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
 
     UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_pressure_size")
index 7ccdf32..03081ff 100644 (file)
@@ -1734,6 +1734,7 @@ static void rna_def_brush(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Use Blender Units",
                                 "When locked brush stays same size relative to object; when unlocked brush size is "
                                 "given in pixels");
+       RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
        RNA_def_property_update(prop, 0, "rna_Brush_update");
 
        prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE);
index 18db0ca..ee30655 100644 (file)
@@ -2939,6 +2939,7 @@ static void rna_def_unified_paint_settings(BlenderRNA  *brna)
        RNA_def_property_ui_text(prop, "Use Blender Units",
                                 "When locked brush stays same size relative to object; "
                                 "when unlocked brush size is given in pixels");
+       RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
 }