pidgin/gtkconv.c

changeset 15733
f9adf674b97f
parent 15692
ecda27df58b9
child 15760
209681319cac
equal deleted inserted replaced
15732:44053ccfe1b5 15733:f9adf674b97f
3336 } 3336 }
3337 3337
3338 static GdkPixbuf * 3338 static GdkPixbuf *
3339 get_chat_buddy_status_icon(GaimConvChat *chat, const char *name, GaimConvChatBuddyFlags flags) 3339 get_chat_buddy_status_icon(GaimConvChat *chat, const char *name, GaimConvChatBuddyFlags flags)
3340 { 3340 {
3341 PidginConversation *gtkconv = PIDGIN_CONVERSATION(chat->conv);
3341 GdkPixbuf *pixbuf, *scale, *scale2; 3342 GdkPixbuf *pixbuf, *scale, *scale2;
3342 char *filename; 3343 char *filename;
3343 const char *image = NULL; 3344 const char *image = NULL;
3344 3345
3345 if (flags & GAIM_CBFLAGS_FOUNDER) { 3346 if (flags & GAIM_CBFLAGS_FOUNDER) {
3346 image = "founder.png"; 3347 image = "founder.png";
3347 } else if (flags & GAIM_CBFLAGS_OP) { 3348 } else if (flags & GAIM_CBFLAGS_OP) {
3348 image = "op.png"; 3349 image = PIDGIN_STOCK_STATUS_OPERATOR;
3349 } else if (flags & GAIM_CBFLAGS_HALFOP) { 3350 } else if (flags & GAIM_CBFLAGS_HALFOP) {
3350 image = "halfop.png"; 3351 image = PIDGIN_STOCK_STATUS_HALFOP;
3351 } else if (flags & GAIM_CBFLAGS_VOICE) { 3352 } else if (flags & GAIM_CBFLAGS_VOICE) {
3352 image = "voice.png"; 3353 image = PIDGIN_STOCK_STATUS_VOICE;
3353 } else if ((!flags) && gaim_conv_chat_is_user_ignored(chat, name)) { 3354 } else if ((!flags) && gaim_conv_chat_is_user_ignored(chat, name)) {
3354 image = "ignored.png"; 3355 image = "ignored.png";
3355 } else { 3356 } else {
3356 return NULL; 3357 return NULL;
3357 } 3358 }
3358 3359
3359 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", image, NULL); 3360 pixbuf = gtk_widget_render_icon (gtkconv->tab_cont, image, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL),
3360 pixbuf = gdk_pixbuf_new_from_file(filename, NULL); 3361 "GtkTreeView");
3361 g_free(filename); 3362
3362
3363 if (!pixbuf) 3363 if (!pixbuf)
3364 return NULL; 3364 return NULL;
3365 3365
3366 scale = gdk_pixbuf_scale_simple(pixbuf, 15, 15, GDK_INTERP_BILINEAR); 3366 scale = gdk_pixbuf_scale_simple(pixbuf, 15, 15, GDK_INTERP_BILINEAR);
3367 g_object_unref(pixbuf); 3367 g_object_unref(pixbuf);

mercurial