UI: remove grease pencil icons

Grease pencil tool now uses an icon for each tool,
previously it mapped icons to tool icons which is now not needed
because for each tool a different brush can be selected which has it's
own icon.
This commit is contained in:
Campbell Barton
2018-11-03 20:33:59 +11:00
parent e53cb83d07
commit f267921774
20 changed files with 5 additions and 35 deletions

View File

@@ -45,7 +45,6 @@ def generate_from_brushes_tool_slots_ex(
brush_category_attr,
brush_category_layout,
# Optional
icon_fn=None,
tooldef_keywords={},
):
# Categories
@@ -55,18 +54,12 @@ def generate_from_brushes_tool_slots_ex(
if brush is None:
continue
category = getattr(brush, brush_category_attr)
if icon_fn is not None:
icon_id = icon_fn(brush)
else:
icon_id = category.lower()
name = brush.name
brush_categories.setdefault(category, []).append(
ToolDef.from_dict(
dict(
text=name,
icon=icon_prefix + icon_id,
icon=icon_prefix + category.lower(),
data_block=name,
**tooldef_keywords,
)
@@ -1385,23 +1378,9 @@ class _defs_gpencil_paint:
def draw_settings(context, layout, tool):
_defs_gpencil_paint.draw_settings_common(context, layout, tool)
def icon_fn(brush):
return {
'PENCIL': 'draw_pencil',
'PEN': 'draw_pen',
'INK': 'draw_ink',
'INKNOISE': 'draw_noise',
'BLOCK': 'draw_block',
'MARKER': 'draw_marker',
'FILL': 'draw_fill',
'SOFT': 'draw.eraser_soft',
'HARD': 'draw.eraser_hard',
'STROKE': 'draw.eraser_stroke',
}[brush.gpencil_settings.gp_icon]
return generate_from_brushes_tool_slots_ex(
context, context.tool_settings.gpencil_paint,
icon_prefix="brush.gpencil.",
icon_prefix="brush.gpencil_draw.",
brush_category_attr="gpencil_tool",
brush_category_layout=(
('DRAW',),
@@ -1412,11 +1391,9 @@ class _defs_gpencil_paint:
operator="gpencil.draw",
draw_settings=draw_settings,
),
icon_fn=icon_fn,
)
class _defs_gpencil_edit:
@ToolDef.from_fn
def bend():

View File

@@ -605,16 +605,9 @@ set(ICON_NAMES
# This section is maintained by the updating script, keep BEGIN/END comments.
set_property(GLOBAL PROPERTY ICON_GEOM_NAMES
# BEGIN ICON_GEOM_NAMES
brush.gpencil.draw.eraser_hard
brush.gpencil.draw.eraser_soft
brush.gpencil.draw.eraser_stroke
brush.gpencil.draw_block
brush.gpencil.draw_fill
brush.gpencil.draw_ink
brush.gpencil.draw_marker
brush.gpencil.draw_noise
brush.gpencil.draw_pen
brush.gpencil.draw_pencil
brush.gpencil_draw.draw
brush.gpencil_draw.erase
brush.gpencil_draw.fill
brush.paint_texture.airbrush
brush.paint_texture.clone
brush.paint_texture.draw