aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-ui-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.c')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 7c6166839..1c20c2c9a 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -544,14 +544,12 @@ empathy_pixbuf_scale_down_if_necessary (GdkPixbuf *pixbuf, gint max_size)
}
GdkPixbuf *
-empathy_pixbuf_from_icon_name (const gchar *icon_name,
- GtkIconSize icon_size)
+empathy_pixbuf_from_icon_name_sized (const gchar *icon_name,
+ gint size)
{
- GtkIconTheme *theme;
- GdkPixbuf *pixbuf = NULL;
- GError *error = NULL;
- gint w, h;
- gint size = 48;
+ GtkIconTheme *theme;
+ GdkPixbuf *pixbuf;
+ GError *error;
if (!icon_name) {
return NULL;
@@ -559,10 +557,6 @@ empathy_pixbuf_from_icon_name (const gchar *icon_name,
theme = gtk_icon_theme_get_default ();
- if (gtk_icon_size_lookup (icon_size, &w, &h)) {
- size = (w + h) / 2;
- }
-
pixbuf = gtk_icon_theme_load_icon (theme,
icon_name,
size,
@@ -576,6 +570,24 @@ empathy_pixbuf_from_icon_name (const gchar *icon_name,
return pixbuf;
}
+GdkPixbuf *
+empathy_pixbuf_from_icon_name (const gchar *icon_name,
+ GtkIconSize icon_size)
+{
+ gint w, h;
+ gint size = 48;
+
+ if (!icon_name) {
+ return NULL;
+ }
+
+ if (gtk_icon_size_lookup (icon_size, &w, &h)) {
+ size = (w + h) / 2;
+ }
+
+ return empathy_pixbuf_from_icon_name_sized (icon_name, size);
+}
+
/* Stolen from GtkSourceView, hence the weird intendation. Please keep it like
* that to make it easier to apply changes from the original code.
*/