[Bf-blender-cvs] [abbcf1172fc] greasepencil-object: UI: Define pin icon for default eraser

Antonio Vazquez noreply at git.blender.org
Sat Mar 3 11:38:35 CET 2018


Commit: abbcf1172fcd43281715276b4e2c87a80746d4f4
Author: Antonio Vazquez
Date:   Sat Mar 3 11:38:16 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBabbcf1172fcd43281715276b4e2c87a80746d4f4

UI: Define pin icon for default eraser

Using pin button keep UI consistency better than a checkbox.

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

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 2445e89980a..e2f890223ad 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2123,13 +2123,13 @@ class VIEW3D_PT_tools_grease_pencil_brush(Panel):
 
             if brush.type == 'ERASE':
                 col = layout.column(align=True)
-                col.prop(brush, "line_width", text="Radius")
+                row = col.row(align=True)
+                row.prop(brush, "line_width", text="Radius")
+                row.prop(brush, "default_eraser", text="")
                 col.separator()
                 row = col.row()
                 row.prop(brush, "eraser_mode", expand=True)
 
-                col.prop(brush, "default_eraser")
-
             if brush.type != 'ERASE':
                 layout.separator()
                 layout.prop(context.tool_settings, "use_gpencil_draw_onback", text="Draw on Back")
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 908de6cc97b..3ec45bbaae6 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2502,6 +2502,7 @@ static void rna_def_gpencil_brush(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "default_eraser", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_DEFAULT_ERASER);
 	RNA_def_property_boolean_default(prop, true);
+	RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
 	RNA_def_property_ui_text(prop, "Default Eraser", "Use this brush when enable eraser with fast switch key");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_brush_default_eraser");
 }



More information about the Bf-blender-cvs mailing list