[gtk+] Prefer symbolic icons in message dialogs
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Prefer symbolic icons in message dialogs
- Date: Sun, 3 Feb 2013 22:58:19 +0000 (UTC)
commit 594b7520809c973eacba2370e8e79ff4fdce060a
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Feb 3 17:58:23 2013 -0500
Prefer symbolic icons in message dialogs
Based on a patch in
https://bugzilla.gnome.org/show_bug.cgi?id=680048
gtk/gtkmessagedialog.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c
index 6a86668..709fcfe 100644
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -425,31 +425,31 @@ setup_type (GtkMessageDialog *dialog,
{
GtkMessageDialogPrivate *priv = dialog->priv;
const gchar *stock_id = NULL;
- const gchar *icon_name = NULL;
AtkObject *atk_obj;
-
+ GIcon *gicon = NULL;
+
priv->message_type = type;
switch (type)
{
case GTK_MESSAGE_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;
case GTK_MESSAGE_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;
case GTK_MESSAGE_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;
-
+
case GTK_MESSAGE_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;
case GTK_MESSAGE_OTHER:
@@ -460,10 +460,10 @@ setup_type (GtkMessageDialog *dialog,
break;
}
- if (icon_name)
- gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), icon_name,
- GTK_ICON_SIZE_DIALOG);
-
+ gtk_image_set_from_gicon (GTK_IMAGE (priv->image), gicon, GTK_ICON_SIZE_DIALOG);
+ if (gicon)
+ g_object_unref (gicon);
+
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (dialog));
if (GTK_IS_ACCESSIBLE (atk_obj))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]