From bb9d36d8aedd2170f895e49421663e5fb00b4c44 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Thu, 17 Jul 2025 20:56:16 +0000 Subject: [PATCH] dialogs, widgets: Check if animations are enabled... ...when setting animations for GtkStack. Adds a check if gimp_widget_animation_enabled () is TRUE before setting an animation type in gtk_stack_set_transition_type (). If it's FALSE, then we turn off animations with GTK_STACK_TRANSITION_TYPE_NONE. This affects the Input Controller dialogue, Preferences dialogue, and the Welcome dialogue. --- app/dialogs/extensions-dialog.c | 4 +++- app/widgets/gimpdeviceeditor.c | 4 +++- app/widgets/gimpprefsbox.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/dialogs/extensions-dialog.c b/app/dialogs/extensions-dialog.c index 772b959c81..a2ffa9e64e 100644 --- a/app/dialogs/extensions-dialog.c +++ b/app/dialogs/extensions-dialog.c @@ -90,7 +90,9 @@ extensions_dialog_new (Gimp *gimp) stack = gtk_stack_new (); gtk_stack_set_transition_type (GTK_STACK (stack), - GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT); + gimp_widget_animation_enabled () ? + GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT : + GTK_STACK_TRANSITION_TYPE_NONE); gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), stack, TRUE, TRUE, 0); gtk_widget_show (stack); diff --git a/app/widgets/gimpdeviceeditor.c b/app/widgets/gimpdeviceeditor.c index cba31697ed..07fc59f267 100644 --- a/app/widgets/gimpdeviceeditor.c +++ b/app/widgets/gimpdeviceeditor.c @@ -200,7 +200,9 @@ gimp_device_editor_init (GimpDeviceEditor *editor) private->stack = gtk_stack_new (); gtk_container_set_border_width (GTK_CONTAINER (private->stack), 12); gtk_stack_set_transition_type (GTK_STACK (private->stack), - GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN); + gimp_widget_animation_enabled () ? + GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN : + GTK_STACK_TRANSITION_TYPE_NONE); gtk_box_pack_start (GTK_BOX (vbox), private->stack, TRUE, TRUE, 0); gtk_widget_show (private->stack); } diff --git a/app/widgets/gimpprefsbox.c b/app/widgets/gimpprefsbox.c index d3217d1307..91f8328760 100644 --- a/app/widgets/gimpprefsbox.c +++ b/app/widgets/gimpprefsbox.c @@ -210,7 +210,9 @@ gimp_prefs_box_init (GimpPrefsBox *box) /* The main preferences stack */ private->stack = gtk_stack_new (); gtk_stack_set_transition_type (GTK_STACK (private->stack), - GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN); + gimp_widget_animation_enabled () ? + GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN : + GTK_STACK_TRANSITION_TYPE_NONE); gtk_box_pack_start (GTK_BOX (vbox), private->stack, TRUE, TRUE, 0); gtk_widget_show (private->stack);