Prefer symbolic icons in message dialogs

Based on a patch in
https://bugzilla.gnome.org/show_bug.cgi?id=680048
This commit is contained in:
Matthias Clasen 2013-02-03 17:58:23 -05:00
parent b08c15d986
commit 594b752080

View File

@ -425,8 +425,8 @@ setup_type (GtkMessageDialog *dialog,
{ {
GtkMessageDialogPrivate *priv = dialog->priv; GtkMessageDialogPrivate *priv = dialog->priv;
const gchar *stock_id = NULL; const gchar *stock_id = NULL;
const gchar *icon_name = NULL;
AtkObject *atk_obj; AtkObject *atk_obj;
GIcon *gicon = NULL;
priv->message_type = type; priv->message_type = type;
@ -434,22 +434,22 @@ setup_type (GtkMessageDialog *dialog,
{ {
case GTK_MESSAGE_INFO: case GTK_MESSAGE_INFO:
stock_id = GTK_STOCK_DIALOG_INFO; stock_id = GTK_STOCK_DIALOG_INFO;
icon_name = GTK_STOCK_DIALOG_INFO "-symbolic"; gicon = g_themed_icon_new_with_default_fallbacks ("dialog-information-symbolic");
break; break;
case GTK_MESSAGE_QUESTION: case GTK_MESSAGE_QUESTION:
stock_id = GTK_STOCK_DIALOG_QUESTION; stock_id = GTK_STOCK_DIALOG_QUESTION;
icon_name = GTK_STOCK_DIALOG_QUESTION "-symbolic"; gicon = g_themed_icon_new_with_default_fallbacks ("dialog-question-symbolic");
break; break;
case GTK_MESSAGE_WARNING: case GTK_MESSAGE_WARNING:
stock_id = GTK_STOCK_DIALOG_WARNING; stock_id = GTK_STOCK_DIALOG_WARNING;
icon_name = GTK_STOCK_DIALOG_WARNING "-symbolic"; gicon = g_themed_icon_new_with_default_fallbacks ("dialog-warning-symbolic");
break; break;
case GTK_MESSAGE_ERROR: case GTK_MESSAGE_ERROR:
stock_id = GTK_STOCK_DIALOG_ERROR; stock_id = GTK_STOCK_DIALOG_ERROR;
icon_name = GTK_STOCK_DIALOG_ERROR "-symbolic"; gicon = g_themed_icon_new_with_default_fallbacks ("dialog-error-symbolic");
break; break;
case GTK_MESSAGE_OTHER: case GTK_MESSAGE_OTHER:
@ -460,9 +460,9 @@ setup_type (GtkMessageDialog *dialog,
break; break;
} }
if (icon_name) gtk_image_set_from_gicon (GTK_IMAGE (priv->image), gicon, GTK_ICON_SIZE_DIALOG);
gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), icon_name, if (gicon)
GTK_ICON_SIZE_DIALOG); g_object_unref (gicon);
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (dialog)); atk_obj = gtk_widget_get_accessible (GTK_WIDGET (dialog));
if (GTK_IS_ACCESSIBLE (atk_obj)) if (GTK_IS_ACCESSIBLE (atk_obj))