app: fix GimpToolEditor visibility-toggle state update

In GimpToolEditor, update the visibiltiy-toggle state in response
to the corresponding tool-item's "notify" signal, rather than its
"shown-changed" signal, since the latter is not emitted when the
item's visibility changes while it's not shown.
This commit is contained in:
Ell
2020-02-02 16:37:12 +02:00
parent 6cc4217ff3
commit df19401fb3

View File

@ -61,7 +61,7 @@ struct _GimpToolEditorPrivate
GtkWidget *delete_button; GtkWidget *delete_button;
GtkWidget *reset_button; GtkWidget *reset_button;
GimpTreeHandler *shown_changed_handler; GimpTreeHandler *tool_item_notify_handler;
/* State of tools at creation of the editor, stored to support /* State of tools at creation of the editor, stored to support
* reverting changes * reverting changes
@ -97,7 +97,8 @@ static void gimp_tool_editor_drop_viewable (GimpContainer
GimpViewable *dest_viewable, GimpViewable *dest_viewable,
GtkTreeViewDropPosition drop_pos); GtkTreeViewDropPosition drop_pos);
static void gimp_tool_editor_shown_changed (GimpToolItem *tool_item, static void gimp_tool_editor_tool_item_notify (GimpToolItem *tool_item,
GParamSpec *pspec,
GimpToolEditor *tool_editor); GimpToolEditor *tool_editor);
static void gimp_tool_editor_eye_data_func (GtkTreeViewColumn *tree_column, static void gimp_tool_editor_eye_data_func (GtkTreeViewColumn *tree_column,
@ -575,8 +576,9 @@ gimp_tool_editor_reset_clicked (GtkButton *button,
} }
static void static void
gimp_tool_editor_shown_changed (GimpToolItem *tool_item, gimp_tool_editor_tool_item_notify (GimpToolItem *tool_item,
GimpToolEditor *tool_editor) GParamSpec *pspec,
GimpToolEditor *tool_editor)
{ {
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (tool_editor); GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (tool_editor);
GimpContainerView *container_view = GIMP_CONTAINER_VIEW (tool_editor); GimpContainerView *container_view = GIMP_CONTAINER_VIEW (tool_editor);
@ -715,7 +717,7 @@ gimp_tool_editor_update_container (GimpToolEditor *tool_editor)
GimpContainer *container; GimpContainer *container;
GimpContext *context; GimpContext *context;
g_clear_pointer (&tool_editor->priv->shown_changed_handler, g_clear_pointer (&tool_editor->priv->tool_item_notify_handler,
gimp_tree_handler_disconnect); gimp_tree_handler_disconnect);
g_clear_pointer (&tool_editor->priv->initial_tool_state, g_free); g_clear_pointer (&tool_editor->priv->initial_tool_state, g_free);
@ -731,9 +733,9 @@ gimp_tool_editor_update_container (GimpToolEditor *tool_editor)
tool_editor->priv->container = container; tool_editor->priv->container = container;
tool_editor->priv->context = context; tool_editor->priv->context = context;
tool_editor->priv->shown_changed_handler = gimp_tree_handler_connect ( tool_editor->priv->tool_item_notify_handler = gimp_tree_handler_connect (
container, "shown-changed", container, "notify",
G_CALLBACK (gimp_tool_editor_shown_changed), G_CALLBACK (gimp_tool_editor_tool_item_notify),
tool_editor); tool_editor);
/* save initial tool order */ /* save initial tool order */