gtk-demo: Speed up image demo

The progressive loading demo here was so slow as to appear
broken. Make it faster, and ensure that it updates regularly.
This commit is contained in:
Matthias Clasen 2020-10-22 00:22:15 -04:00
parent ef7499a31b
commit 44c6619660

View File

@ -56,6 +56,7 @@ progressive_updated_callback (GdkPixbufLoader *loader,
picture = GTK_WIDGET (data);
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
gtk_picture_set_pixbuf (GTK_PICTURE (picture), NULL);
gtk_picture_set_pixbuf (GTK_PICTURE (picture), pixbuf);
}
@ -262,7 +263,7 @@ start_progressive_loading (GtkWidget *picture)
* The timeout simply simulates a slow data source by inserting
* pauses in the reading process.
*/
load_timeout = g_timeout_add (1500, progressive_timeout, picture);
load_timeout = g_timeout_add (300, progressive_timeout, picture);
g_source_set_name_by_id (load_timeout, "[gtk] progressive_timeout");
}