Grease Pencil: use standard eraser and paint brush cursors

Ref D5197
This commit is contained in:
Harley Acheson
2019-09-26 14:31:52 +02:00
committed by Brecht Van Lommel
parent 47fdac8ad9
commit e56f71d03f
3 changed files with 5 additions and 4 deletions

View File

@@ -199,7 +199,7 @@ class _defs_annotate:
idname="builtin.annotate_line", idname="builtin.annotate_line",
label="Annotate Line", label="Annotate Line",
icon="ops.gpencil.draw.line", icon="ops.gpencil.draw.line",
cursor='CROSSHAIR', cursor='PAINT_BRUSH',
keymap="Generic Tool: Annotate Line", keymap="Generic Tool: Annotate Line",
draw_settings=draw_settings, draw_settings=draw_settings,
) )
@@ -210,7 +210,7 @@ class _defs_annotate:
idname="builtin.annotate_polygon", idname="builtin.annotate_polygon",
label="Annotate Polygon", label="Annotate Polygon",
icon="ops.gpencil.draw.poly", icon="ops.gpencil.draw.poly",
cursor='CROSSHAIR', cursor='PAINT_BRUSH',
keymap="Generic Tool: Annotate Polygon", keymap="Generic Tool: Annotate Polygon",
draw_settings=draw_settings, draw_settings=draw_settings,
) )
@@ -225,7 +225,7 @@ class _defs_annotate:
idname="builtin.annotate_eraser", idname="builtin.annotate_eraser",
label="Annotate Eraser", label="Annotate Eraser",
icon="ops.gpencil.draw.eraser", icon="ops.gpencil.draw.eraser",
cursor='CROSSHAIR', # XXX: Always show brush circle when enabled cursor='ERASER',
keymap="Generic Tool: Annotate Eraser", keymap="Generic Tool: Annotate Eraser",
draw_settings=draw_settings, draw_settings=draw_settings,
) )

View File

@@ -1560,7 +1560,7 @@ static int gpencil_draw_init(bContext *C, wmOperator *op, const wmEvent *event)
static void gpencil_draw_cursor_set(tGPsdata *p) static void gpencil_draw_cursor_set(tGPsdata *p)
{ {
if (p->paintmode == GP_PAINTMODE_ERASER) { if (p->paintmode == GP_PAINTMODE_ERASER) {
WM_cursor_modal_set(p->win, WM_CURSOR_CROSS); /* XXX need a better cursor */ WM_cursor_modal_set(p->win, WM_CURSOR_ERASER);
} }
else { else {
WM_cursor_modal_set(p->win, WM_CURSOR_PAINT_BRUSH); WM_cursor_modal_set(p->win, WM_CURSOR_PAINT_BRUSH);

View File

@@ -54,6 +54,7 @@ const EnumPropertyItem rna_enum_window_cursor_items[] = {
{WM_CURSOR_KNIFE, "KNIFE", 0, "Knife", ""}, {WM_CURSOR_KNIFE, "KNIFE", 0, "Knife", ""},
{WM_CURSOR_TEXT_EDIT, "TEXT", 0, "Text", ""}, {WM_CURSOR_TEXT_EDIT, "TEXT", 0, "Text", ""},
{WM_CURSOR_PAINT_BRUSH, "PAINT_BRUSH", 0, "Paint Brush", ""}, {WM_CURSOR_PAINT_BRUSH, "PAINT_BRUSH", 0, "Paint Brush", ""},
{WM_CURSOR_ERASER, "ERASER", 0, "Eraser", ""},
{WM_CURSOR_HAND, "HAND", 0, "Hand", ""}, {WM_CURSOR_HAND, "HAND", 0, "Hand", ""},
{WM_CURSOR_EW_SCROLL, "SCROLL_X", 0, "Scroll-X", ""}, {WM_CURSOR_EW_SCROLL, "SCROLL_X", 0, "Scroll-X", ""},
{WM_CURSOR_NS_SCROLL, "SCROLL_Y", 0, "Scroll-Y", ""}, {WM_CURSOR_NS_SCROLL, "SCROLL_Y", 0, "Scroll-Y", ""},