mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-09 09:54:14 +00:00
fix icon
This commit is contained in:
parent
a0a6a5c206
commit
91e22f0035
@ -1,5 +1,9 @@
|
|||||||
use adw::StatusPage;
|
use adw::StatusPage;
|
||||||
|
|
||||||
|
const DEFAULT_TITLE: &str = "Oops";
|
||||||
|
const DEFAULT_DESCRIPTION: Option<&str> = None;
|
||||||
|
const DEFAULT_ICON_NAME: &str = "dialog-error";
|
||||||
|
|
||||||
pub struct Widget {
|
pub struct Widget {
|
||||||
gobject: StatusPage,
|
gobject: StatusPage,
|
||||||
}
|
}
|
||||||
@ -11,11 +15,17 @@ impl Widget {
|
|||||||
pub fn new(title: Option<&str>, description: Option<&str>) -> Self {
|
pub fn new(title: Option<&str>, description: Option<&str>) -> Self {
|
||||||
let gobject = StatusPage::new();
|
let gobject = StatusPage::new();
|
||||||
|
|
||||||
if let Some(value) = title {
|
gobject.set_title(match title {
|
||||||
gobject.set_title(value);
|
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 }
|
Self { gobject }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user