| 1713 |
1713 |
| 1714 GdkPixbuf * pidgin_create_status_icon(PurpleStatusPrimitive prim, GtkWidget *w, const char *size) |
1714 GdkPixbuf * pidgin_create_status_icon(PurpleStatusPrimitive prim, GtkWidget *w, const char *size) |
| 1715 { |
1715 { |
| 1716 GtkIconSize icon_size = gtk_icon_size_from_name(size); |
1716 GtkIconSize icon_size = gtk_icon_size_from_name(size); |
| 1717 GdkPixbuf *pixbuf = NULL; |
1717 GdkPixbuf *pixbuf = NULL; |
| 1718 |
1718 const char *stock = pidgin_stock_id_from_status_primitive(prim); |
| 1719 if (prim == PURPLE_STATUS_UNAVAILABLE) |
1719 |
| 1720 pixbuf = gtk_widget_render_icon (w, PIDGIN_STOCK_STATUS_BUSY, |
1720 pixbuf = gtk_widget_render_icon (w, stock ? stock : PIDGIN_STOCK_STATUS_AVAILABLE, |
| 1721 icon_size, "GtkWidget"); |
1721 icon_size, "GtkWidget"); |
| 1722 else if (prim == PURPLE_STATUS_AWAY) |
|
| 1723 pixbuf = gtk_widget_render_icon (w, PIDGIN_STOCK_STATUS_AWAY, |
|
| 1724 icon_size, "GtkWidget"); |
|
| 1725 else if (prim == PURPLE_STATUS_EXTENDED_AWAY) |
|
| 1726 pixbuf = gtk_widget_render_icon (w, PIDGIN_STOCK_STATUS_XA, |
|
| 1727 icon_size, "GtkWidget"); |
|
| 1728 else if (prim == PURPLE_STATUS_INVISIBLE) |
|
| 1729 pixbuf = gtk_widget_render_icon (w, PIDGIN_STOCK_STATUS_INVISIBLE, |
|
| 1730 icon_size, "GtkWidget"); |
|
| 1731 else if (prim == PURPLE_STATUS_OFFLINE) |
|
| 1732 pixbuf = gtk_widget_render_icon (w, PIDGIN_STOCK_STATUS_OFFLINE, |
|
| 1733 icon_size, "GtkWidget"); |
|
| 1734 else |
|
| 1735 pixbuf = gtk_widget_render_icon (w, PIDGIN_STOCK_STATUS_AVAILABLE, |
|
| 1736 icon_size, "GtkWidget"); |
|
| 1737 return pixbuf; |
1722 return pixbuf; |
| 1738 |
|
| 1739 } |
1723 } |
| 1740 |
1724 |
| 1741 const char * |
1725 const char * |
| 1742 pidgin_stock_id_from_status_primitive(PurpleStatusPrimitive prim) |
1726 pidgin_stock_id_from_status_primitive(PurpleStatusPrimitive prim) |
| 1743 { |
1727 { |