mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 01:43:24 +00:00
tools, widgets: Don't show Fx icon for tool-based filters
We use GEGL filters for some of our currently destructive editing only tools, like Warp and Bucket Fill. While eventually these will have non-destructive options, for now it's confusing to show an Fx icon briefly when the tools are active. This patch sets these filters as temporary, and updates the GimpItemTreeView code to not show the Fx icon if there is only one filter and it is temporary. Temporary filters can not be deleted from the NDE pop-up, only from their tools, preventing another set of reported crashes.
This commit is contained in:
parent
d46b6e4e0e
commit
cc50ef99a6
6 changed files with 27 additions and 7 deletions
|
@ -371,6 +371,7 @@ gimp_bucket_fill_tool_start (GimpBucketFillTool *tool,
|
|||
tool->priv->filter = gimp_drawable_filter_new (drawables->data, _("Bucket fill"),
|
||||
tool->priv->graph,
|
||||
GIMP_ICON_TOOL_BUCKET_FILL);
|
||||
g_object_set (tool->priv->filter, "temporary", TRUE, NULL);
|
||||
|
||||
gimp_drawable_filter_set_region (tool->priv->filter,
|
||||
GIMP_FILTER_REGION_DRAWABLE);
|
||||
|
|
|
@ -1105,6 +1105,7 @@ gimp_gradient_tool_create_filter (GimpGradientTool *gradient_tool,
|
|||
C_("undo-type", "Gradient"),
|
||||
gradient_tool->graph,
|
||||
GIMP_ICON_TOOL_GRADIENT);
|
||||
g_object_set (gradient_tool->filter, "temporary", TRUE, NULL);
|
||||
|
||||
gimp_drawable_filter_set_region (gradient_tool->filter,
|
||||
GIMP_FILTER_REGION_DRAWABLE);
|
||||
|
|
|
@ -755,6 +755,7 @@ gimp_seamless_clone_tool_create_filter (GimpSeamlessCloneTool *sc,
|
|||
_("Seamless Clone"),
|
||||
sc->render_node,
|
||||
GIMP_ICON_TOOL_SEAMLESS_CLONE);
|
||||
g_object_set (sc->filter, "temporary", TRUE, NULL);
|
||||
|
||||
gimp_drawable_filter_set_region (sc->filter, GIMP_FILTER_REGION_DRAWABLE);
|
||||
|
||||
|
|
|
@ -2040,11 +2040,12 @@ filter_new (GimpTransformGridTool *tg_tool,
|
|||
|
||||
gimp_gegl_node_set_underlying_operation (node, filter->transform_node);
|
||||
|
||||
filter->filter = gimp_drawable_filter_new (
|
||||
drawable,
|
||||
filter->filter =
|
||||
gimp_drawable_filter_new (drawable,
|
||||
GIMP_TRANSFORM_TOOL_GET_CLASS (tg_tool)->undo_desc,
|
||||
node,
|
||||
gimp_tool_get_icon_name (GIMP_TOOL (tg_tool)));
|
||||
g_object_set (filter->filter, "temporary", TRUE, NULL);
|
||||
|
||||
gimp_drawable_filter_set_clip (filter->filter, FALSE);
|
||||
gimp_drawable_filter_set_override_constraints (filter->filter, TRUE);
|
||||
|
|
|
@ -1091,6 +1091,7 @@ gimp_warp_tool_create_filter (GimpWarpTool *wt,
|
|||
_("Warp transform"),
|
||||
wt->graph,
|
||||
GIMP_ICON_TOOL_WARP);
|
||||
g_object_set (wt->filter, "temporary", TRUE, NULL);
|
||||
|
||||
gimp_drawable_filter_set_region (wt->filter, GIMP_FILTER_REGION_DRAWABLE);
|
||||
|
||||
|
|
|
@ -3003,6 +3003,7 @@ gimp_item_tree_view_filters_changed (GimpItem *item,
|
|||
GList *filter_list = NULL;
|
||||
gint n_filters = 0;
|
||||
gboolean fs_disabled = FALSE;
|
||||
gboolean temporary_only = TRUE;
|
||||
|
||||
iter = gimp_container_view_lookup (container_view,
|
||||
(GimpViewable *) item);
|
||||
|
@ -3016,11 +3017,25 @@ gimp_item_tree_view_filters_changed (GimpItem *item,
|
|||
filter_list = g_list_previous (filter_list))
|
||||
{
|
||||
if (GIMP_IS_DRAWABLE_FILTER (filter_list->data))
|
||||
{
|
||||
n_filters++;
|
||||
|
||||
if (temporary_only)
|
||||
g_object_get (filter_list->data,
|
||||
"temporary", &temporary_only,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
fs_disabled = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Don't show icon if we only have a temporary filter
|
||||
* like a tool-based filter */
|
||||
if (temporary_only)
|
||||
n_filters = 0;
|
||||
|
||||
if (n_filters == 0 || fs_disabled)
|
||||
view->priv->effects_filter = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue