From 8e4e83911ca47f4a4cdcd851f9f296edc4f71c37 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Mon, 9 Mar 2026 01:53:00 +0000 Subject: [PATCH] dialogs: Set "Quit Save" icon size based on theme The "Save"/"Save as" icons that appear in the Quit Dialog when there are two or more images with unsaved changes were always sized as GTK_ICON_SIZE_MENU, or 16px, regardless of icon theme settings. This patch adds code on Quit Dialog creation to check the current theme and update the icon size accordingly via `quit_style_updated ()`. Note that this is a limited implementation due to the pending release of GIMP 3.2. It is not connected to notify::custom-icon-size signals to reduce complexity and potential issues. In the future, we may move this to the parent GimpMessageDialog if other dialogs would also benefit from getting a button icon size from the theme. --- app/dialogs/quit-dialog.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/app/dialogs/quit-dialog.c b/app/dialogs/quit-dialog.c index a36f765fe2..8782bc6d75 100644 --- a/app/dialogs/quit-dialog.c +++ b/app/dialogs/quit-dialog.c @@ -28,6 +28,7 @@ #include "dialogs-types.h" #include "config/gimpcoreconfig.h" +#include "config/gimpguiconfig.h" #include "core/gimp.h" #include "core/gimpcontainer.h" @@ -113,6 +114,10 @@ static gboolean quit_close_all_dialog_query_tooltip (GtkWidget *w QuitDialog *private); static gboolean quit_close_all_idle (QuitDialog *private); +static void quit_style_updated (GimpGuiConfig *config, + GParamSpec *pspec, + GObject *button); + /* public functions */ @@ -251,6 +256,8 @@ quit_close_all_dialog_new (Gimp *gimp, g_object_set (renderer, "icon-name", "document-save", NULL); + quit_style_updated (GIMP_GUI_CONFIG (gimp->config), NULL, + G_OBJECT (renderer)); gtk_tree_view_column_pack_end (column, renderer, FALSE); gtk_tree_view_column_set_attributes (column, renderer, NULL); @@ -640,3 +647,32 @@ quit_close_all_idle (QuitDialog *private) return FALSE; } + +static void +quit_style_updated (GimpGuiConfig *config, + GParamSpec *pspec, + GObject *button) +{ + GtkIconSize icon_size = GTK_ICON_SIZE_MENU; + + if (config->override_icon_size) + { + switch (config->custom_icon_size) + { + case GIMP_ICON_SIZE_LARGE: + icon_size = GTK_ICON_SIZE_LARGE_TOOLBAR; + break; + + case GIMP_ICON_SIZE_HUGE: + icon_size = GTK_ICON_SIZE_DND; + break; + + case GIMP_ICON_SIZE_MEDIUM: + case GIMP_ICON_SIZE_SMALL: + default: + icon_size = GTK_ICON_SIZE_MENU; + } + } + + g_object_set (button, "stock-size", icon_size, NULL); +}