Mercurial > pidgin
comparison plugins/gevolution/gevolution.c @ 13090:0aa231ebbfd5
[gaim-migrate @ 15452]
Changes to some pixbuf stuff.
I added a 'gaim_gtk_create_gaim_icon_with_status()' function to util.c,
and changed 'gaim_gtk_create_prpl_icon_with_status()' to accept a scale
factor because almost everywhere this function was used we would scale
the pixbuf to a smaller size as soon as we got it. So there's a bit less
code duplication.
Also, I think I added some g_object_unref()'s in one or two places where
it was missing.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Wed, 01 Feb 2006 22:38:34 +0000 |
| parents | 248b8b39c671 |
| children |
comparison
equal
deleted
inserted
replaced
| 13089:b553326bc468 | 13090:0aa231ebbfd5 |
|---|---|
| 403 GtkWidget *label; | 403 GtkWidget *label; |
| 404 GtkWidget *sw; | 404 GtkWidget *sw; |
| 405 GtkWidget *treeview; | 405 GtkWidget *treeview; |
| 406 GtkTreeViewColumn *column; | 406 GtkTreeViewColumn *column; |
| 407 GtkCellRenderer *renderer; | 407 GtkCellRenderer *renderer; |
| 408 GdkPixbuf *pixbuf, *scale = NULL; | 408 GdkPixbuf *pixbuf; |
| 409 GtkListStore *model; | 409 GtkListStore *model; |
| 410 GList *l; | 410 GList *l; |
| 411 | 411 |
| 412 /* Outside container */ | 412 /* Outside container */ |
| 413 ret = gtk_vbox_new(FALSE, 18); | 413 ret = gtk_vbox_new(FALSE, 18); |
| 481 | 481 |
| 482 gaim_debug_info("evolution", "Adding account\n"); | 482 gaim_debug_info("evolution", "Adding account\n"); |
| 483 | 483 |
| 484 gtk_list_store_append(model, &iter); | 484 gtk_list_store_append(model, &iter); |
| 485 | 485 |
| 486 pixbuf = gaim_gtk_create_prpl_icon(account); | 486 pixbuf = gaim_gtk_create_prpl_icon(account, 0.5); |
| 487 | 487 if ((pixbuf != NULL) && (!gaim_account_is_connected(account))) |
| 488 if (pixbuf != NULL) | 488 gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); |
| 489 { | |
| 490 scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, | |
| 491 GDK_INTERP_BILINEAR); | |
| 492 | |
| 493 if (!gaim_account_is_connected(account)) | |
| 494 gdk_pixbuf_saturate_and_pixelate(scale, scale, 0.0, FALSE); | |
| 495 } | |
| 496 | 489 |
| 497 gtk_list_store_set(model, &iter, | 490 gtk_list_store_set(model, &iter, |
| 498 COLUMN_AUTOADD, | 491 COLUMN_AUTOADD, |
| 499 gaim_account_get_bool(account, "gevo-autoadd", | 492 gaim_account_get_bool(account, "gevo-autoadd", |
| 500 FALSE), | 493 FALSE), |
| 501 COLUMN_ICON, scale, | 494 COLUMN_ICON, pixbuf, |
| 502 COLUMN_SCREENNAME, | 495 COLUMN_SCREENNAME, |
| 503 gaim_account_get_username(account), | 496 gaim_account_get_username(account), |
| 504 COLUMN_DATA, account, | 497 COLUMN_DATA, account, |
| 505 -1); | 498 -1); |
| 506 | 499 |
| 507 if (pixbuf != NULL) g_object_unref(G_OBJECT(pixbuf)); | 500 if (pixbuf != NULL) |
| 508 if (scale != NULL) g_object_unref(G_OBJECT(scale)); | 501 g_object_unref(G_OBJECT(pixbuf)); |
| 509 } | 502 } |
| 510 | 503 |
| 511 gtk_widget_show_all(ret); | 504 gtk_widget_show_all(ret); |
| 512 | 505 |
| 513 return ret; | 506 return ret; |
