patches/gtk3+-01-window-icons-for-message-dialog.diff
author yippi
Mon, 27 Sep 2010 21:07:51 +0000
changeset 20108 51df67ca9307
parent 18292 9ff9c0fa64d9
permissions -rw-r--r--
I had these modules listed as being owned by me, but they are really owned by wangke, correcting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18292
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     1
--- gtk+-2.10.6/gtk/gtkmessagedialog.c.orig	2006-05-14 05:25:29.000000000 +0100
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     2
+++ gtk+-2.10.6/gtk/gtkmessagedialog.c	2006-12-14 10:16:04.369253000 +0000
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     3
@@ -303,6 +303,24 @@
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     4
 }
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     5
 
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     6
 static void
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     7
+set_window_icon_from_stock (GtkMessageDialog *dialog,
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     8
+                            const gchar      *stock_id)
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
     9
+{
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    10
+  GdkPixbuf *icon;
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    11
+
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    12
+  icon = gtk_widget_render_icon (GTK_WIDGET (dialog),
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    13
+                                stock_id,
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    14
+                                GTK_ICON_SIZE_DIALOG,
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    15
+                                NULL);
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    16
+
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    17
+  if (icon) {
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    18
+     gtk_window_set_icon (GTK_WINDOW (dialog), icon);
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    19
+
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    20
+     g_object_unref (icon);
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    21
+  }
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    22
+}
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    23
+
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    24
+static void
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    25
 setup_type (GtkMessageDialog *dialog,
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    26
 	    GtkMessageType    type)
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    27
 {
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    28
@@ -836,20 +854,22 @@
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    29
 {
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    30
   GtkMessageDialog *dialog = GTK_MESSAGE_DIALOG (widget);
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    31
   gboolean use_separator;
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    32
-  GtkWidget *parent;
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    33
+  GtkWidget *image;
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    34
   gint border_width;
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    35
 
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    36
-  parent = GTK_WIDGET (GTK_MESSAGE_DIALOG (widget)->image->parent);
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    37
+  image = GTK_MESSAGE_DIALOG (widget)->image;
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    38
 
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    39
-  if (parent)
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    40
+  if (image->parent)
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    41
     {
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    42
       gtk_widget_style_get (widget, "message-border",
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    43
                             &border_width, NULL);
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    44
       
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    45
-      gtk_container_set_border_width (GTK_CONTAINER (parent),
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    46
+      gtk_container_set_border_width (GTK_CONTAINER (image->parent),
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    47
                                       MAX (0, border_width - 7));
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    48
     }
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    49
 
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    50
+  set_window_icon_from_stock (GTK_MESSAGE_DIALOG (widget),
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    51
+                              GTK_IMAGE (image)->data.stock.stock_id);
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    52
   gtk_widget_style_get (widget,
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    53
 			"use-separator", &use_separator,
9ff9c0fa64d9 2010-07-29 Christian Kelly <[email protected]>
chrisk
parents:
diff changeset
    54
 			NULL);