mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
fix icon
This commit is contained in:
parent
a0a6a5c206
commit
91e22f0035
1 changed files with 14 additions and 4 deletions
|
|
@ -1,5 +1,9 @@
|
|||
use adw::StatusPage;
|
||||
|
||||
const DEFAULT_TITLE: &str = "Oops";
|
||||
const DEFAULT_DESCRIPTION: Option<&str> = None;
|
||||
const DEFAULT_ICON_NAME: &str = "dialog-error";
|
||||
|
||||
pub struct Widget {
|
||||
gobject: StatusPage,
|
||||
}
|
||||
|
|
@ -11,11 +15,17 @@ impl Widget {
|
|||
pub fn new(title: Option<&str>, description: Option<&str>) -> Self {
|
||||
let gobject = StatusPage::new();
|
||||
|
||||
if let Some(value) = title {
|
||||
gobject.set_title(value);
|
||||
}
|
||||
gobject.set_title(match title {
|
||||
Some(value) => value,
|
||||
None => DEFAULT_TITLE,
|
||||
});
|
||||
|
||||
gobject.set_description(description);
|
||||
gobject.set_description(match description {
|
||||
Some(value) => Some(value),
|
||||
None => DEFAULT_DESCRIPTION,
|
||||
});
|
||||
|
||||
gobject.set_icon_name(Some(DEFAULT_ICON_NAME));
|
||||
|
||||
Self { gobject }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue