mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +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
|
|
@ -13,6 +13,8 @@ use gtk::{
|
|||
prelude::{BoxExt, WidgetExt},
|
||||
Box, Orientation,
|
||||
};
|
||||
use std::time::Duration;
|
||||
|
||||
pub struct Content {
|
||||
// GTK
|
||||
gobject: Box,
|
||||
|
|
@ -46,9 +48,14 @@ impl Content {
|
|||
}
|
||||
|
||||
/// Loading placeholder
|
||||
pub fn set_status_loading(&self, title: Option<&str>, description: Option<&str>) -> Status {
|
||||
pub fn set_status_loading(
|
||||
&self,
|
||||
title: Option<&str>,
|
||||
description: Option<&str>,
|
||||
show_with_delay: Option<Duration>,
|
||||
) -> Status {
|
||||
self.clean();
|
||||
let status = Status::new_loading(title, description);
|
||||
let status = Status::new_loading(title, description, show_with_delay);
|
||||
self.gobject.append(status.gobject());
|
||||
status
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue