widgets: Set up help-ids properly

This patch adds gimp_help_connect () calls before
gImp_set_help_data () to set up F1 keybind to work
properly. It also adds lock_visibility_help_id to channel
view.

Resolves #11718
This commit is contained in:
cheesequake 2024-06-28 04:34:01 +05:30 committed by Jehan
parent f9c790c73f
commit aad228cfeb
3 changed files with 33 additions and 18 deletions

View File

@ -131,6 +131,7 @@ gimp_channel_tree_view_class_init (GimpChannelTreeViewClass *klass)
iv_class->delete_action = "channels-delete";
iv_class->lock_content_help_id = GIMP_HELP_CHANNEL_LOCK_PIXELS;
iv_class->lock_position_help_id = GIMP_HELP_CHANNEL_LOCK_POSITION;
iv_class->lock_visibility_help_id = GIMP_HELP_CHANNEL_LOCK_VISIBILITY;
}
static void

View File

@ -771,6 +771,9 @@ gimp_item_tree_view_constructed (GObject *object)
item_view->priv->effects_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, button_spacing);
item_view->priv->effects_options = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, button_spacing);
gimp_help_connect (item_view->priv->effects_filters, gimp_standard_help_func,
GIMP_HELP_LAYER_EFFECTS, NULL, NULL);
/* Effects Buttons */
item_view->priv->effects_visible_button = gtk_toggle_button_new ();
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item_view->priv->effects_visible_button),
@ -778,7 +781,8 @@ gimp_item_tree_view_constructed (GObject *object)
image = gtk_image_new_from_icon_name (GIMP_ICON_VISIBLE,
GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_container_add (GTK_CONTAINER (item_view->priv->effects_visible_button), image);
gimp_help_connect (item_view->priv->effects_visible_button, gimp_standard_help_func,
GIMP_HELP_LAYER_EFFECTS, NULL, NULL);
gimp_help_set_help_data (item_view->priv->effects_visible_button,
_("Toggle the visibility of all filters."),
GIMP_HELP_LAYER_EFFECTS);
@ -793,6 +797,8 @@ gimp_item_tree_view_constructed (GObject *object)
item_view->priv->effects_edit_button =
gtk_button_new_from_icon_name (GIMP_ICON_EDIT,
GTK_ICON_SIZE_SMALL_TOOLBAR);
gimp_help_connect (item_view->priv->effects_edit_button, gimp_standard_help_func,
GIMP_HELP_LAYER_EFFECTS, NULL, NULL);
gimp_help_set_help_data (item_view->priv->effects_edit_button,
_("Edit the selected filter."),
GIMP_HELP_LAYER_EFFECTS);
@ -806,6 +812,8 @@ gimp_item_tree_view_constructed (GObject *object)
item_view->priv->effects_raise_button =
gtk_button_new_from_icon_name (GIMP_ICON_GO_UP,
GTK_ICON_SIZE_SMALL_TOOLBAR);
gimp_help_connect (item_view->priv->effects_raise_button, gimp_standard_help_func,
GIMP_HELP_LAYER_EFFECTS, NULL, NULL);
gimp_help_set_help_data (item_view->priv->effects_raise_button,
_("Raise filter one step up in the stack."),
GIMP_HELP_LAYER_EFFECTS);
@ -819,6 +827,8 @@ gimp_item_tree_view_constructed (GObject *object)
item_view->priv->effects_lower_button =
gtk_button_new_from_icon_name (GIMP_ICON_GO_DOWN,
GTK_ICON_SIZE_SMALL_TOOLBAR);
gimp_help_connect (item_view->priv->effects_lower_button, gimp_standard_help_func,
GIMP_HELP_LAYER_EFFECTS, NULL, NULL);
gimp_help_set_help_data (item_view->priv->effects_lower_button,
_("Lower filter one step down in the stack."),
GIMP_HELP_LAYER_EFFECTS);
@ -832,6 +842,8 @@ gimp_item_tree_view_constructed (GObject *object)
item_view->priv->effects_merge_button =
gtk_button_new_from_icon_name (GIMP_ICON_LAYER_MERGE_DOWN,
GTK_ICON_SIZE_SMALL_TOOLBAR);
gimp_help_connect (item_view->priv->effects_merge_button, gimp_standard_help_func,
GIMP_HELP_LAYER_EFFECTS, NULL, NULL);
gimp_help_set_help_data (item_view->priv->effects_merge_button,
_("Merge all active filters down."),
GIMP_HELP_LAYER_EFFECTS);
@ -845,6 +857,8 @@ gimp_item_tree_view_constructed (GObject *object)
item_view->priv->effects_remove_button =
gtk_button_new_from_icon_name (GIMP_ICON_EDIT_DELETE,
GTK_ICON_SIZE_SMALL_TOOLBAR);
gimp_help_connect (item_view->priv->effects_remove_button, gimp_standard_help_func,
GIMP_HELP_LAYER_EFFECTS, NULL, NULL);
gimp_help_set_help_data (item_view->priv->effects_remove_button,
_("Remove the selected filter."),
GIMP_HELP_LAYER_EFFECTS);
@ -1299,6 +1313,7 @@ gimp_item_tree_view_add_lock (GimpItemTreeView *view,
G_CALLBACK (gimp_item_tree_view_lock_button_release),
view);
gimp_help_connect (toggle, gimp_standard_help_func, help_id, NULL, NULL);
gimp_help_set_help_data (toggle, tooltip, help_id);
gtk_widget_style_get (GTK_WIDGET (view),

View File

@ -285,9 +285,8 @@ gimp_layer_tree_view_init (GimpLayerTreeView *view)
g_signal_connect (view->priv->layer_mode_box, "notify::layer-mode",
G_CALLBACK (gimp_layer_tree_view_layer_mode_box_callback),
view);
gimp_help_set_help_data (view->priv->layer_mode_box, NULL,
GIMP_HELP_LAYER_DIALOG_PAINT_MODE_MENU);
gimp_help_connect (view->priv->layer_mode_box, gimp_standard_help_func,
GIMP_HELP_LAYER_DIALOG_PAINT_MODE_MENU, NULL, NULL);
/* Opacity scale */
@ -295,8 +294,8 @@ gimp_layer_tree_view_init (GimpLayerTreeView *view)
1.0, 10.0, 0.0);
scale = gimp_spin_scale_new (view->priv->opacity_adjustment, _("Opacity"), 1);
gimp_spin_scale_set_constrain_drag (GIMP_SPIN_SCALE (scale), TRUE);
gimp_help_set_help_data (scale, NULL,
GIMP_HELP_LAYER_DIALOG_OPACITY_SCALE);
gimp_help_connect (scale, gimp_standard_help_func,
GIMP_HELP_LAYER_DIALOG_OPACITY_SCALE, NULL, NULL);
gimp_item_tree_view_add_options (GIMP_ITEM_TREE_VIEW (view),
NULL, scale);