| 684 cur = g_new0(struct smiley_button_list, 1); |
684 cur = g_new0(struct smiley_button_list, 1); |
| 685 it = ls; |
685 it = ls; |
| 686 it_last = ls; /* list iterators */ |
686 it_last = ls; /* list iterators */ |
| 687 image = gtk_image_new_from_file(filename); |
687 image = gtk_image_new_from_file(filename); |
| 688 |
688 |
| 689 gtk_widget_size_request(image, &size); |
689 gtk_widget_get_preferred_size(image, NULL, &size); |
| 690 |
690 |
| 691 if ((size.width > 24) |
691 if ((size.width > 24) |
| 692 && (gtk_webview_smiley_get_flags(smiley) & GTK_WEBVIEW_SMILEY_CUSTOM)) { |
692 && (gtk_webview_smiley_get_flags(smiley) & GTK_WEBVIEW_SMILEY_CUSTOM)) { |
| 693 /* This is a custom smiley, let's scale it */ |
693 /* This is a custom smiley, let's scale it */ |
| 694 GdkPixbuf *pixbuf = NULL; |
694 GdkPixbuf *pixbuf = NULL; |
| 710 GdkPixbuf *resized; |
710 GdkPixbuf *resized; |
| 711 resized = gdk_pixbuf_scale_simple(pixbuf, 24, 24, |
711 resized = gdk_pixbuf_scale_simple(pixbuf, 24, 24, |
| 712 GDK_INTERP_HYPER); |
712 GDK_INTERP_HYPER); |
| 713 |
713 |
| 714 gtk_image_set_from_pixbuf(GTK_IMAGE(image), resized); /* This unrefs pixbuf */ |
714 gtk_image_set_from_pixbuf(GTK_IMAGE(image), resized); /* This unrefs pixbuf */ |
| 715 gtk_widget_size_request(image, &size); |
715 gtk_widget_get_preferred_size(image, NULL, &size); |
| 716 g_object_unref(G_OBJECT(resized)); |
716 g_object_unref(G_OBJECT(resized)); |
| 717 } |
717 } |
| 718 } |
718 } |
| 719 |
719 |
| 720 (*width) += size.width; |
720 (*width) += size.width; |
| 892 g_signal_connect(G_OBJECT(manage), "clicked", |
892 g_signal_connect(G_OBJECT(manage), "clicked", |
| 893 G_CALLBACK(pidgin_smiley_manager_show), NULL); |
893 G_CALLBACK(pidgin_smiley_manager_show), NULL); |
| 894 g_signal_connect_swapped(G_OBJECT(manage), "clicked", |
894 g_signal_connect_swapped(G_OBJECT(manage), "clicked", |
| 895 G_CALLBACK(gtk_widget_destroy), dialog); |
895 G_CALLBACK(gtk_widget_destroy), dialog); |
| 896 gtk_box_pack_end(GTK_BOX(vbox), manage, FALSE, TRUE, 0); |
896 gtk_box_pack_end(GTK_BOX(vbox), manage, FALSE, TRUE, 0); |
| 897 gtk_widget_size_request(manage, &req); |
897 gtk_widget_get_preferred_size(manage, NULL, &req); |
| 898 button_width = req.width; |
898 button_width = req.width; |
| 899 } |
899 } |
| 900 |
900 |
| 901 /* create list of smileys sorted by height */ |
901 /* create list of smileys sorted by height */ |
| 902 while (unique_smileys) { |
902 while (unique_smileys) { |
| 944 GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(toolbar)))); |
944 GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(toolbar)))); |
| 945 |
945 |
| 946 /* show everything */ |
946 /* show everything */ |
| 947 gtk_widget_show_all(dialog); |
947 gtk_widget_show_all(dialog); |
| 948 |
948 |
| 949 gtk_widget_size_request(viewport, &req); |
949 gtk_widget_get_preferred_size(viewport, NULL, &req); |
| 950 gtk_widget_set_size_request(scrolled, MIN(300, req.width), MIN(290, req.height)); |
950 gtk_widget_set_size_request(scrolled, MIN(300, req.width), MIN(290, req.height)); |
| 951 |
951 |
| 952 /* The window has to be made resizable, and the scrollbars in the scrolled window |
952 /* The window has to be made resizable, and the scrollbars in the scrolled window |
| 953 * enabled only after setting the desired size of the window. If we do either of |
953 * enabled only after setting the desired size of the window. If we do either of |
| 954 * these tasks before now, GTK+ miscalculates the required size, and erronously |
954 * these tasks before now, GTK+ miscalculates the required size, and erronously |
| 1153 GtkAllocation allocation; |
1153 GtkAllocation allocation; |
| 1154 gint ythickness = gtk_widget_get_style(widget)->ythickness; |
1154 gint ythickness = gtk_widget_get_style(widget)->ythickness; |
| 1155 int savy; |
1155 int savy; |
| 1156 |
1156 |
| 1157 gtk_widget_get_allocation(widget, &allocation); |
1157 gtk_widget_get_allocation(widget, &allocation); |
| 1158 gtk_widget_size_request(GTK_WIDGET(menu), &menu_req); |
1158 gtk_widget_get_preferred_size(GTK_WIDGET(menu), NULL, &menu_req); |
| 1159 gdk_window_get_origin(gtk_widget_get_window(widget), x, y); |
1159 gdk_window_get_origin(gtk_widget_get_window(widget), x, y); |
| 1160 *x += allocation.x; |
1160 *x += allocation.x; |
| 1161 *y += allocation.y + allocation.height; |
1161 *y += allocation.y + allocation.height; |
| 1162 savy = *y; |
1162 savy = *y; |
| 1163 |
1163 |