implement show_with_delay option

This commit is contained in:
yggverse 2024-10-30 03:55:39 +02:00
parent 0912f2c68d
commit a336b18ac3
5 changed files with 51 additions and 9 deletions

View file

@ -29,7 +29,7 @@ use gtk::{
Box,
};
use sqlite::Transaction;
use std::{cell::RefCell, sync::Arc};
use std::{cell::RefCell, sync::Arc, time::Duration};
pub struct Page {
id: GString,
@ -548,7 +548,8 @@ impl Page {
// Final image size unknown, show loading widget
let status = content.set_status_loading(
Some(&"Loading.."),
None
None,
Some(Duration::from_secs(1)) // show if download time > 1 second
);
// Asynchronously move `InputStream` data from `SocketConnection` into the local `MemoryInputStream`