Revision ac36b2e6a56f5addff8d870411c6c32848fe80a9
seanegan at pidgin.im
seanegan at pidgin.im
Mon Mar 5 19:07:14 EST 2007
o -----------------------------------------------------------------
| Revision: ac36b2e6a56f5addff8d870411c6c32848fe80a9
| Ancestor: 067ea44e6ccbaf069872e7e7463c6a3514389018
| Author: seanegan at pidgin.im
| Date: 2007-03-06T00:06:58
| Branch: im.pidgin.pidgin
|
| Modified files:
| pidgin/gtkdocklet-x11.c
|
| ChangeLog:
|
| change icon on resize
|
| ============================================================
| --- pidgin/gtkdocklet-x11.c 08ba7c16699e7a012b0b821b8adba7422876acdf
| +++ pidgin/gtkdocklet-x11.c b3b38dd36d790285ba71d22dd7690338f07ca13e
| @@ -40,6 +40,8 @@ static int embed_timeout = 0;
| static GtkTooltips *tooltips = NULL;
| static GdkPixbuf *blank_icon = NULL;
| static int embed_timeout = 0;
| +static DockletStatus icon_status = 0;
| +static int docklet_height = 0;
|
| /* protos */
| static void docklet_x11_create(void);
| @@ -117,16 +119,26 @@ docklet_x11_update_icon(DockletStatus ic
|
| if(icon_name) {
| int icon_size;
| - GtkAllocation alloc = GTK_WIDGET(docklet)->allocation;
| - if (alloc.height < 22)
| + if (docklet_height < 22)
| icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL);
| else
| icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL);
| +
| gtk_image_set_from_stock(GTK_IMAGE(image), icon_name, icon_size);
| }
| + icon_status = icon;
| }
|
| static void
| +docklet_x11_resize_icon(GtkWidget *widget)
| +{
| + if (docklet_height == widget->allocation.height)
| + return;
| + docklet_height = widget->allocation.height;
| + docklet_x11_update_icon(icon_status);
| +}
| +
| +static void
| docklet_x11_blank_icon()
| {
| if (!blank_icon) {
| @@ -241,8 +253,8 @@ docklet_x11_create()
|
| g_signal_connect(G_OBJECT(docklet), "embedded", G_CALLBACK(docklet_x11_embedded_cb), NULL);
| g_signal_connect(G_OBJECT(docklet), "destroy", G_CALLBACK(docklet_x11_destroyed_cb), NULL);
| + g_signal_connect(G_OBJECT(docklet), "size-allocate", G_CALLBACK(docklet_x11_resize_icon), NULL);
| g_signal_connect(G_OBJECT(box), "button-release-event", G_CALLBACK(docklet_x11_clicked_cb), NULL);
| -
| gtk_container_add(GTK_CONTAINER(box), image);
| gtk_container_add(GTK_CONTAINER(docklet), box);
|
To get the patch for this revision, please do this:
mtn log --last 1 --diffs --from ac36b2e6a56f5addff8d870411c6c32848fe80a9
More information about the Commits
mailing list