pidgin/gtkimhtml.c

changeset 31941
0ba7a6657b39
parent 31889
96183796df0c
child 32189
3af8d41121b6
child 33707
3ce33bc98c02
equal deleted inserted replaced
31940:e21eefd6503b 31941:0ba7a6657b39
5689 } 5689 }
5690 5690
5691 static void 5691 static void
5692 gtk_custom_smiley_size_prepared(GdkPixbufLoader *loader, gint width, gint height, gpointer data) 5692 gtk_custom_smiley_size_prepared(GdkPixbufLoader *loader, gint width, gint height, gpointer data)
5693 { 5693 {
5694 #define CUSTOM_SMILEY_SIZE 96 /* XXX: Should this be a theme setting? */ 5694 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/resize_custom_smileys")) {
5695 if (width <= CUSTOM_SMILEY_SIZE && height <= CUSTOM_SMILEY_SIZE) 5695 int custom_smileys_size = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/custom_smileys_size");
5696 return; 5696 if (width <= custom_smileys_size && height <= custom_smileys_size)
5697 5697 return;
5698 if (width >= height) { 5698
5699 height = height * CUSTOM_SMILEY_SIZE / width; 5699 if (width >= height) {
5700 width = CUSTOM_SMILEY_SIZE; 5700 height = height * custom_smileys_size / width;
5701 } else { 5701 width = custom_smileys_size;
5702 width = width * CUSTOM_SMILEY_SIZE / height; 5702 } else {
5703 height = CUSTOM_SMILEY_SIZE; 5703 width = width * custom_smileys_size / height;
5704 } 5704 height = custom_smileys_size;
5705 5705 }
5706 }
5706 gdk_pixbuf_loader_set_size(loader, width, height); 5707 gdk_pixbuf_loader_set_size(loader, width, height);
5707 } 5708 }
5708 5709
5709 void 5710 void
5710 gtk_imhtml_smiley_reload(GtkIMHtmlSmiley *smiley) 5711 gtk_imhtml_smiley_reload(GtkIMHtmlSmiley *smiley)

mercurial