changeset 2513:6e52448f352a

[gaim-migrate @ 2526] ability to reenable animation. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 15 Oct 2001 21:04:37 +0000
parents bf7ec3874810
children 6fffd664b78a
files src/conversation.c
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Mon Oct 15 20:08:15 2001 +0000
+++ b/src/conversation.c	Mon Oct 15 21:04:37 2001 +0000
@@ -2670,6 +2670,18 @@
 	c->icon_timer = 0;
 }
 
+static void start_anim(GtkObject *obj, struct conversation *c)
+{
+	GList *frames;
+	GdkPixbufFrame *frame;
+	int delay;
+
+	frames = gdk_pixbuf_animation_get_frames(c->anim);
+	frame = g_list_nth_data(frames, c->frame);
+	delay = MAX(gdk_pixbuf_frame_get_delay_time(frame), 13);
+	c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c);
+}
+
 static int des_save_icon(GtkObject *obj, GdkEvent *e, struct conversation *c)
 {
 	gtk_widget_destroy(c->save_icon);
@@ -2745,6 +2757,11 @@
 		gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(stop_anim), c);
 		gtk_menu_append(GTK_MENU(menu), button);
 		gtk_widget_show(button);
+	} else if (c->anim) {
+		button = gtk_menu_item_new_with_label(_("Enable Animation"));
+		gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(start_anim), c);
+		gtk_menu_append(GTK_MENU(menu), button);
+		gtk_widget_show(button);
 	}
 
 	button = gtk_menu_item_new_with_label(_("Hide Icon"));