dialogs: Reduce About Dialog animations if requested

The About Dialog shows authors names using motion effects.
Since this is done with Cairo, it does not respect the
"gtk-enable-animations" setting or OSX's "Reduced Motion"
option.

This patch retrieves the "gtk-enable-animations" value.
If it is set to false, then the simple fade-in effect is used
for author names in place of the motion effects.
This commit is contained in:
Alx Sa 2024-06-02 02:05:24 +00:00
parent 57012174fb
commit e13cc63525

View file

@ -685,6 +685,13 @@ about_dialog_timer (gpointer data)
{
GimpAboutDialog *dialog = data;
gint timeout = 0;
gboolean use_animation = TRUE;
/* Use a simple fade-in effect rather than more dynamics motions
* if the user has requested reduced animations */
g_object_get (gtk_settings_get_default (),
"gtk-enable-animations", &use_animation,
NULL);
if (dialog->animstep == 0)
{
@ -727,7 +734,8 @@ about_dialog_timer (gpointer data)
if (dialog->animstep < 16)
{
decorate_text (dialog, 2, ((gfloat) dialog->animstep) / 15.0);
decorate_text (dialog, use_animation ? 2 : 0,
((gfloat) dialog->animstep) / 15.0);
}
else if (dialog->animstep == 16)
{
@ -739,7 +747,7 @@ about_dialog_timer (gpointer data)
}
else if (dialog->animstep < 33)
{
decorate_text (dialog, 1,
decorate_text (dialog, use_animation ? 1 : 0,
1.0 - ((gfloat) (dialog->animstep - 17)) / 15.0);
}
else if (dialog->animstep == 33)