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.
This commit is contained in:
Alx Sa 2025-01-02 23:21:50 -05:00
parent 3da281c468
commit 86861952aa
3 changed files with 19 additions and 2 deletions

View File

@ -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");

View File

@ -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);

View File

@ -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);