mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
implement show_with_delay option
This commit is contained in:
parent
0912f2c68d
commit
a336b18ac3
5 changed files with 51 additions and 9 deletions
|
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue