app: add small hack to make the generic operation tool always invisible

so it can't be added to the toolbox. It's entirely useless when
activated on its own.
This commit is contained in:
Michael Natterer 2018-01-04 19:23:39 +01:00
parent b95bb99e05
commit 895c0f558f
3 changed files with 7 additions and 1 deletions

View File

@ -151,7 +151,7 @@ gimp_tool_info_set_property (GObject *object,
switch (property_id)
{
case PROP_VISIBLE:
tool_info->visible = g_value_get_boolean (value);
tool_info->visible = (g_value_get_boolean (value) && ! tool_info->hidden);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);

View File

@ -51,6 +51,7 @@ struct _GimpToolInfo
gchar *help_domain;
gchar *help_id;
gboolean hidden; /* can't be made visible */
gboolean visible;
GimpToolOptions *tool_options;
GimpPaintInfo *paint_info;

View File

@ -586,6 +586,11 @@ gimp_tools_register (GType tool_type,
visible = (! g_type_is_a (tool_type, GIMP_TYPE_FILTER_TOOL));
g_object_set (tool_info, "visible", visible, NULL);
/* hack to make the operation tools always invisible */
if (tool_type == GIMP_TYPE_OPERATION_TOOL)
tool_info->hidden = TRUE;
g_object_set_data (G_OBJECT (tool_info), "gimp-tool-default-visible",
GINT_TO_POINTER (visible));