mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
update totals on loading
This commit is contained in:
parent
1d03e98b89
commit
6447b2279f
3 changed files with 34 additions and 23 deletions
|
|
@ -13,22 +13,33 @@ pub struct Status {
|
|||
impl Status {
|
||||
// Constructors
|
||||
|
||||
/// Create new default failure component
|
||||
/// Create new failure preset
|
||||
///
|
||||
/// Useful as placeholder widget for error handlers
|
||||
pub fn new_failure(title: Option<&str>, description: Option<&str>) -> Self {
|
||||
Self {
|
||||
gobject: Failure::new(title, description).gobject().clone(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create new default loading component
|
||||
/// Create new loading preset
|
||||
///
|
||||
/// Useful as the placeholder widget for async operations
|
||||
/// Useful as placeholder widget for async operations
|
||||
pub fn new_loading(title: Option<&str>, description: Option<&str>) -> Self {
|
||||
Self {
|
||||
gobject: Loading::new(title, description).gobject().clone(),
|
||||
}
|
||||
}
|
||||
|
||||
// Setters
|
||||
|
||||
/// Set new description for status component
|
||||
///
|
||||
/// Useful for loading widgets to update byte totals and other dynamically changed information
|
||||
pub fn set_description(&self, description: Option<&str>) {
|
||||
self.gobject.set_description(description);
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
pub fn gobject(&self) -> &StatusPage {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue