From 897ffd5702dfe960cd20b8916b237ecee8540bd5 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Fri, 12 Dec 2025 02:18:23 +0000 Subject: [PATCH] dialogs: Canvas Size fill combo set to insensitive... ...if layers won't be resized. This patch adds code to check if the "Resize layers" option is set to None and "Resize Text Layers" is turned off. If so, then the "Fill With" combobox is not needed and will be set to insensitive to reduce confusion. Otherwise, the fill combo is set to enabled. --- app/dialogs/resize-dialog.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/app/dialogs/resize-dialog.c b/app/dialogs/resize-dialog.c index 40990ca070..d7d4a187e6 100644 --- a/app/dialogs/resize-dialog.c +++ b/app/dialogs/resize-dialog.c @@ -112,6 +112,8 @@ static void reset_template_clicked (GtkWidget *button, ResizeDialog *private); static void ppi_select_toggled (GtkWidget *radio, ResizeDialog *private); +static void check_fill_sensitivity (GtkWidget *widget, + ResizeDialog *private); /* public function */ @@ -228,9 +230,9 @@ resize_dialog_new (GimpViewable *viewable, NULL); gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog), - RESPONSE_RESET, - GTK_RESPONSE_OK, - GTK_RESPONSE_CANCEL, + RESPONSE_RESET, + GTK_RESPONSE_OK, + GTK_RESPONSE_CANCEL, -1); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); @@ -487,6 +489,8 @@ resize_dialog_new (GimpViewable *viewable, private->layer_set, G_CALLBACK (gimp_int_combo_box_get_active), &private->layer_set, NULL); + g_signal_connect (combo, "changed", G_CALLBACK (check_fill_sensitivity), + private); } hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); @@ -526,12 +530,16 @@ resize_dialog_new (GimpViewable *viewable, g_signal_connect (button, "toggled", G_CALLBACK (gimp_toggle_button_update), &private->resize_text_layers); + g_signal_connect (button, "toggled", G_CALLBACK (check_fill_sensitivity), + private); gimp_help_set_help_data (button, _("Resizing text layers will make them uneditable"), NULL); g_object_unref (size_group); + + check_fill_sensitivity (NULL, private); } return dialog; @@ -850,3 +858,16 @@ reset_template_clicked (GtkWidget *button, { gimp_context_set_template (private->context, NULL); } + +static void +check_fill_sensitivity (GtkWidget *widget, + ResizeDialog *private) +{ + gboolean sensitive = TRUE; + + if (private->layer_set == GIMP_ITEM_SET_NONE && + ! private->resize_text_layers) + sensitive = FALSE; + + gtk_widget_set_sensitive (private->fill_type_combo, sensitive); +}