From 86861952aaf18e96cc4261d93da470b7348622b4 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Thu, 2 Jan 2025 23:21:50 -0500 Subject: [PATCH] dialogs: Add Help buttons to About/Tips/Welcome dialogs The About, Tips, and Welcome dialogues had Help IDs created, but they were not being used on the dialogues themselves. This meant there was no help button, and pressing F1 did not pull up the help manual when pressed. To be consistent, the Help ID was added to the gimp_dialog_new () calls for Tips and Welcome. Since About is not based on GimpDialog, this patch adds it manually (after checking to make sure the user has enabled help buttons in Preferences). This patch also constrains the Tip dialogue's initial width to match the About and Welcome dialogues. --- app/dialogs/about-dialog.c | 12 ++++++++++++ app/dialogs/tips-dialog.c | 4 +++- app/dialogs/welcome-dialog.c | 5 ++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/dialogs/about-dialog.c b/app/dialogs/about-dialog.c index 81b8b6afbbe..03db2de2eec 100644 --- a/app/dialogs/about-dialog.c +++ b/app/dialogs/about-dialog.c @@ -29,7 +29,9 @@ #include "dialogs-types.h" #include "config/gimpcoreconfig.h" +#include "config/gimpguiconfig.h" +#include "widgets/gimphelp-ids.h" #include "widgets/gimpwidgets-utils.h" #include "about.h" @@ -214,6 +216,16 @@ about_dialog_create (Gimp *gimp, g_list_free (children); } + if (GIMP_GUI_CONFIG (config)->show_help_button) + { + gimp_help_connect (dialog.dialog, NULL, gimp_standard_help_func, + GIMP_HELP_ABOUT_DIALOG, NULL, NULL); + + gtk_dialog_add_buttons (GTK_DIALOG (dialog.dialog), + _("_Help"), GTK_RESPONSE_HELP, + NULL); + } + gtk_style_context_add_class (gtk_widget_get_style_context (dialog.dialog), "gimp-about-dialog"); diff --git a/app/dialogs/tips-dialog.c b/app/dialogs/tips-dialog.c index ac23dfba150..4970bb53d5c 100644 --- a/app/dialogs/tips-dialog.c +++ b/app/dialogs/tips-dialog.c @@ -127,7 +127,8 @@ tips_dialog_create (Gimp *gimp) tips_dialog = gimp_dialog_new (_("GIMP Tip of the Day"), "gimp-tip-of-the-day", - NULL, 0, NULL, NULL, + NULL, 0, gimp_standard_help_func, + GIMP_HELP_TIPS_DIALOG, NULL); button = gtk_dialog_add_button (GTK_DIALOG (tips_dialog), @@ -178,6 +179,7 @@ tips_dialog_create (Gimp *gimp) gtk_widget_show (image); tip_label = gtk_label_new (NULL); + gtk_label_set_max_width_chars (GTK_LABEL (tip_label), 70); gtk_label_set_selectable (GTK_LABEL (tip_label), TRUE); gtk_label_set_justify (GTK_LABEL (tip_label), GTK_JUSTIFY_LEFT); gtk_label_set_line_wrap (GTK_LABEL (tip_label), TRUE); diff --git a/app/dialogs/welcome-dialog.c b/app/dialogs/welcome-dialog.c index edcaedddbb5..5cb39c57c8d 100644 --- a/app/dialogs/welcome-dialog.c +++ b/app/dialogs/welcome-dialog.c @@ -51,7 +51,9 @@ #include "gui/themes.h" #include "menus/menus.h" + #include "widgets/gimpdialogfactory.h" +#include "widgets/gimphelp-ids.h" #include "widgets/gimpprefsbox.h" #include "widgets/gimpuimanager.h" #include "widgets/gimpwidgets-utils.h" @@ -186,7 +188,8 @@ welcome_dialog_new (Gimp *gimp, dialog = gimp_dialog_new (title, "gimp-welcome-dialog", windows ? windows->data : NULL, - 0, NULL, NULL, + 0, gimp_standard_help_func, + GIMP_HELP_WELCOME_DIALOG, _("_Close"), GTK_RESPONSE_CLOSE, NULL); g_list_free (windows); -- GitLab