app: add gimp_tool_widget_add_group()

... which adds a regular (non-filling, non-stroking) canvas-item
group to the widget.
This commit is contained in:
Ell 2020-05-14 23:47:01 +03:00
parent 8c1a277007
commit 1a8f0b6cd6
2 changed files with 16 additions and 6 deletions

View File

@ -553,14 +553,13 @@ gimp_tool_widget_remove_item (GimpToolWidget *widget,
}
GimpCanvasGroup *
gimp_tool_widget_add_stroke_group (GimpToolWidget *widget)
gimp_tool_widget_add_group (GimpToolWidget *widget)
{
GimpCanvasItem *item;
g_return_val_if_fail (GIMP_IS_TOOL_WIDGET (widget), NULL);
item = gimp_canvas_group_new (widget->private->shell);
gimp_canvas_group_set_group_stroking (GIMP_CANVAS_GROUP (item), TRUE);
gimp_tool_widget_add_item (widget, item);
g_object_unref (item);
@ -568,6 +567,19 @@ gimp_tool_widget_add_stroke_group (GimpToolWidget *widget)
return GIMP_CANVAS_GROUP (item);
}
GimpCanvasGroup *
gimp_tool_widget_add_stroke_group (GimpToolWidget *widget)
{
GimpCanvasItem *item;
g_return_val_if_fail (GIMP_IS_TOOL_WIDGET (widget), NULL);
item = gimp_tool_widget_add_group (widget);
gimp_canvas_group_set_group_stroking (GIMP_CANVAS_GROUP (item), TRUE);
return GIMP_CANVAS_GROUP (item);
}
GimpCanvasGroup *
gimp_tool_widget_add_fill_group (GimpToolWidget *widget)
{
@ -575,12 +587,9 @@ gimp_tool_widget_add_fill_group (GimpToolWidget *widget)
g_return_val_if_fail (GIMP_IS_TOOL_WIDGET (widget), NULL);
item = gimp_canvas_group_new (widget->private->shell);
item = gimp_tool_widget_add_group (widget);
gimp_canvas_group_set_group_filling (GIMP_CANVAS_GROUP (item), TRUE);
gimp_tool_widget_add_item (widget, item);
g_object_unref (item);
return GIMP_CANVAS_GROUP (item);
}

View File

@ -175,6 +175,7 @@ void gimp_tool_widget_add_item (GimpToolWidget *widget,
void gimp_tool_widget_remove_item (GimpToolWidget *widget,
GimpCanvasItem *item);
GimpCanvasGroup * gimp_tool_widget_add_group (GimpToolWidget *widget);
GimpCanvasGroup * gimp_tool_widget_add_stroke_group (GimpToolWidget *widget);
GimpCanvasGroup * gimp_tool_widget_add_fill_group (GimpToolWidget *widget);