Skip to content

Commit

Permalink
Fix missing dialog icons in GTK 3.24.48
Browse files Browse the repository at this point in the history
Upstream caused a patch conflict:
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7587

The changes in #114 (9129a63) to fix the patch were not 100%
complete. The icon variable was set outside [update_accessible_name] of
the function [setup_type] that actually sets this icon. Even though
repeating the case select is a bit like code duplication, it works and
fixes the regression.
  • Loading branch information
lah7 committed Jan 26, 2025
1 parent 5edc145 commit 6d5c290
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions appearance__message-dialogs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,41 +56,40 @@ Index: b/gtk/gtkmessagedialog.c
if (name && name[0])
{
atk_object_set_name (atk_obj, name);
@@ -384,18 +396,22 @@
{
case GTK_MESSAGE_INFO:
name = _("Information");
+ icon = "dialog-info";
break;

case GTK_MESSAGE_QUESTION:
name = _("Question");
+ icon = "dialog-question";
break;

case GTK_MESSAGE_WARNING:
name = _("Warning");
+ icon = "dialog-warning";
break;

case GTK_MESSAGE_ERROR:
name = _("Error");
+ icon = "dialog-error";
break;

case GTK_MESSAGE_OTHER:
@@ -415,6 +431,7 @@
@@ -415,6 +427,7 @@ setup_type (GtkMessageDialog *dialog,
GtkMessageType type)
{
GtkMessageDialogPrivate *priv = dialog->priv;
+ const gchar *icon = NULL;
AtkObject *atk_obj;

if (priv->message_type == type)
@@ -423,6 +440,12 @@
@@ -423,6 +436,34 @@ setup_type (GtkMessageDialog *dialog,
priv->message_type = type;


+ switch (dialog->priv->message_type)
+ {
+ case GTK_MESSAGE_INFO:
+ icon = "dialog-info";
+ break;
+
+ case GTK_MESSAGE_QUESTION:
+ icon = "dialog-question";
+ break;
+
+ case GTK_MESSAGE_WARNING:
+ icon = "dialog-warning";
+ break;
+
+ case GTK_MESSAGE_ERROR:
+ icon = "dialog-error";
+ break;
+
+ case GTK_MESSAGE_OTHER:
+ break;
+ }
+
+ if (icon)
+ {
+ GtkWidget *image = gtk_image_new_from_icon_name (icon, GTK_ICON_SIZE_DIALOG);
Expand Down

0 comments on commit 6d5c290

Please sign in to comment.