From 2371c047583d8f2b1711fd15769100c391be472d Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Fri, 25 Apr 2025 00:51:28 +0000 Subject: [PATCH] widgets: Don't show hidden tools on tooltip The tool group tooltip was not updated when users toggled the visibility of tools in Preferences. This patch adds a check before adding a tool to the tooltip, to make sure it's visible first. It also clears out tool group tooltips on mouse over to ensure the tooltip is updated. --- app/widgets/gimptoolbutton.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/widgets/gimptoolbutton.c b/app/widgets/gimptoolbutton.c index 79ca5b8067..b960660f64 100644 --- a/app/widgets/gimptoolbutton.c +++ b/app/widgets/gimptoolbutton.c @@ -466,6 +466,10 @@ gimp_tool_button_query_tooltip (GtkWidget *widget, { GimpToolButton *tool_button = GIMP_TOOL_BUTTON (widget); + if (tool_button->priv->tooltip_widget && + GIMP_IS_TOOL_GROUP (tool_button->priv->tool_item)) + g_clear_object (&tool_button->priv->tooltip_widget); + if (! tool_button->priv->tooltip_widget) { GimpToolInfo *tool_info; @@ -549,11 +553,14 @@ gimp_tool_button_query_tooltip (GtkWidget *widget, for (i = 0; i < n_children; i++) { GimpToolInfo *other_tool_info; + gboolean visible; other_tool_info = GIMP_TOOL_INFO ( gimp_container_get_child_by_index (children, i)); - if (other_tool_info != tool_info) + visible = + gimp_tool_item_get_visible (GIMP_TOOL_ITEM (other_tool_info)); + if (other_tool_info != tool_info && visible) { gimp_tool_button_query_tooltip_add_tool ( tool_button,