[Bf-blender-cvs] [b662ff5cae1] greasepencil-object: UI: Make Tool text shorter and less repetitive

Antonio Vazquez noreply at git.blender.org
Wed Jul 11 15:48:38 CEST 2018


Commit: b662ff5cae12fc0e71fdd5745aefbbd175054853
Author: Antonio Vazquez
Date:   Wed Jul 11 15:41:51 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBb662ff5cae12fc0e71fdd5745aefbbd175054853

UI: Make Tool text shorter and less repetitive

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

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

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

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 31a0e43e278..6f3e4eab956 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -63,10 +63,19 @@ def generate_from_brushes_ex(
             if getattr(brush, brush_test_attr):
                 category = getattr(brush.gpencil_settings, brush_category_attr)
                 name = brush.name
+                if name.startswith("Draw "):
+                    text = name.replace("Draw ", "")
+                elif name.startswith("Eraser "):
+                    text = name.replace("Eraser ", "")
+                elif name.startswith("Fill "):
+                    text = name.replace(" Area", "")
+                else:
+                    text = name
+
                 brush_categories.setdefault(category, []).append(
                     ToolDef.from_dict(
                         dict(
-                            text=name,
+                            text=text,
                             icon=icon_prefix + category.lower().replace(" ", "_"),
                             data_block=name,
                             widget=None,



More information about the Bf-blender-cvs mailing list