Mercurial > pidgin
comparison src/gtkstatusbox.c @ 13062:1ef760c65174
[gaim-migrate @ 15424]
Make icons for popular status show up smaller when using the small list
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 28 Jan 2006 23:11:13 +0000 |
parents | fb607b2d4ff2 |
children | 788409b5a7f0 |
comparison
equal
deleted
inserted
replaced
13061:6332531e14a7 | 13062:1ef760c65174 |
---|---|
477 static void | 477 static void |
478 add_popular_statuses(GtkGaimStatusBox *statusbox) | 478 add_popular_statuses(GtkGaimStatusBox *statusbox) |
479 { | 479 { |
480 GList *list, *cur; | 480 GList *list, *cur; |
481 GtkIconSize icon_size; | 481 GtkIconSize icon_size; |
482 GdkPixbuf *pixbuf, *emblem, *scale; | 482 GdkPixbuf *pixbuf, *emblem; |
483 int width, height; | |
483 | 484 |
484 list = gaim_savedstatuses_get_popular(6); | 485 list = gaim_savedstatuses_get_popular(6); |
485 if (list == NULL) | 486 if (list == NULL) |
486 /* Odd... oh well, nothing we can do about it. */ | 487 /* Odd... oh well, nothing we can do about it. */ |
487 return; | 488 return; |
492 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); | 493 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); |
493 | 494 |
494 /* Create the icon to use for non-transient saved-statuses */ | 495 /* Create the icon to use for non-transient saved-statuses */ |
495 pixbuf = gtk_widget_render_icon(GTK_WIDGET(statusbox->vbox), | 496 pixbuf = gtk_widget_render_icon(GTK_WIDGET(statusbox->vbox), |
496 GAIM_STOCK_STATUS_ONLINE, icon_size, "GtkGaimStatusBox"); | 497 GAIM_STOCK_STATUS_ONLINE, icon_size, "GtkGaimStatusBox"); |
497 scale = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); | |
498 g_object_unref(G_OBJECT(pixbuf)); | |
499 pixbuf = scale; | |
500 | 498 |
501 emblem = gtk_widget_render_icon(GTK_WIDGET(statusbox->vbox), | 499 emblem = gtk_widget_render_icon(GTK_WIDGET(statusbox->vbox), |
502 GTK_STOCK_SAVE, icon_size, "GtkGaimStatusBox"); | 500 GTK_STOCK_SAVE, icon_size, "GtkGaimStatusBox"); |
503 scale = gdk_pixbuf_scale_simple(emblem, 15, 15, GDK_INTERP_BILINEAR); | 501 width = gdk_pixbuf_get_width(pixbuf) / 2; |
504 g_object_unref(G_OBJECT(emblem)); | 502 height = gdk_pixbuf_get_height(pixbuf) / 2; |
505 emblem = scale; | 503 |
506 | 504 gdk_pixbuf_composite(emblem, pixbuf, width, height, |
507 gdk_pixbuf_composite(emblem, pixbuf, 32-15, 32-15, 15, 15, 17, 17, 1, 1, | 505 width, height, width, height, |
508 GDK_INTERP_BILINEAR, 255); | 506 0.5, 0.5, GDK_INTERP_BILINEAR, 255); |
509 g_object_unref(G_OBJECT(emblem)); | 507 g_object_unref(G_OBJECT(emblem)); |
510 | 508 |
511 gtk_gaim_status_box_add_separator(statusbox); | 509 gtk_gaim_status_box_add_separator(statusbox); |
512 | 510 |
513 for (cur = list; cur != NULL; cur = cur->next) | 511 for (cur = list; cur != NULL; cur = cur->next) |