mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
add custom failure icons support
This commit is contained in:
parent
41875de347
commit
ae1d3531bf
3 changed files with 35 additions and 13 deletions
|
|
@ -50,9 +50,14 @@ impl Content {
|
|||
/// Set new `content::Status` component for `Self` with new `status::Failure` preset
|
||||
///
|
||||
/// * action removes previous children component from `Self`
|
||||
pub fn set_status_failure(&self, title: Option<&str>, description: Option<&str>) -> Status {
|
||||
pub fn set_status_failure(
|
||||
&self,
|
||||
title: Option<&str>,
|
||||
description: Option<&str>,
|
||||
icon_name: Option<&str>,
|
||||
) -> Status {
|
||||
self.clean();
|
||||
let status = Status::new_failure(title, description);
|
||||
let status = Status::new_failure(title, description, icon_name);
|
||||
self.gobject.append(status.gobject());
|
||||
status
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,9 +17,15 @@ impl Status {
|
|||
/// Create new failure preset
|
||||
///
|
||||
/// Useful as placeholder widget for error handlers
|
||||
pub fn new_failure(title: Option<&str>, description: Option<&str>) -> Self {
|
||||
pub fn new_failure(
|
||||
title: Option<&str>,
|
||||
description: Option<&str>,
|
||||
icon_name: Option<&str>,
|
||||
) -> Self {
|
||||
Self {
|
||||
gobject: Failure::new(title, description, None).gobject().clone(),
|
||||
gobject: Failure::new(title, description, icon_name)
|
||||
.gobject()
|
||||
.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue