comparison src/conversation.c @ 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 a452084e1636
children f42fceb6a9ea
comparison
equal deleted inserted replaced
2512:bf7ec3874810 2513:6e52448f352a
2668 if (c->icon_timer) 2668 if (c->icon_timer)
2669 gtk_timeout_remove(c->icon_timer); 2669 gtk_timeout_remove(c->icon_timer);
2670 c->icon_timer = 0; 2670 c->icon_timer = 0;
2671 } 2671 }
2672 2672
2673 static void start_anim(GtkObject *obj, struct conversation *c)
2674 {
2675 GList *frames;
2676 GdkPixbufFrame *frame;
2677 int delay;
2678
2679 frames = gdk_pixbuf_animation_get_frames(c->anim);
2680 frame = g_list_nth_data(frames, c->frame);
2681 delay = MAX(gdk_pixbuf_frame_get_delay_time(frame), 13);
2682 c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c);
2683 }
2684
2673 static int des_save_icon(GtkObject *obj, GdkEvent *e, struct conversation *c) 2685 static int des_save_icon(GtkObject *obj, GdkEvent *e, struct conversation *c)
2674 { 2686 {
2675 gtk_widget_destroy(c->save_icon); 2687 gtk_widget_destroy(c->save_icon);
2676 c->save_icon = NULL; 2688 c->save_icon = NULL;
2677 return TRUE; 2689 return TRUE;
2741 menu = gtk_menu_new(); 2753 menu = gtk_menu_new();
2742 2754
2743 if (c->icon_timer) { 2755 if (c->icon_timer) {
2744 button = gtk_menu_item_new_with_label(_("Disable Animation")); 2756 button = gtk_menu_item_new_with_label(_("Disable Animation"));
2745 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(stop_anim), c); 2757 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(stop_anim), c);
2758 gtk_menu_append(GTK_MENU(menu), button);
2759 gtk_widget_show(button);
2760 } else if (c->anim) {
2761 button = gtk_menu_item_new_with_label(_("Enable Animation"));
2762 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(start_anim), c);
2746 gtk_menu_append(GTK_MENU(menu), button); 2763 gtk_menu_append(GTK_MENU(menu), button);
2747 gtk_widget_show(button); 2764 gtk_widget_show(button);
2748 } 2765 }
2749 2766
2750 button = gtk_menu_item_new_with_label(_("Hide Icon")); 2767 button = gtk_menu_item_new_with_label(_("Hide Icon"));