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

@ -5,6 +5,7 @@ use failure::Failure;
use loading::Loading;
use adw::StatusPage;
use std::time::Duration;
pub struct Status {
gobject: StatusPage,
@ -25,9 +26,15 @@ impl Status {
/// Create new loading preset
///
/// Useful as placeholder widget for async operations
pub fn new_loading(title: Option<&str>, description: Option<&str>) -> Self {
pub fn new_loading(
title: Option<&str>,
description: Option<&str>,
show_with_delay: Option<Duration>,
) -> Self {
Self {
gobject: Loading::new(title, description).gobject().clone(),
gobject: Loading::new(title, description, show_with_delay)
.gobject()
.clone(),
}
}