add warning status to toast
This commit is contained in:
parent
c1acd8cdda
commit
1b40f89fdd
1 changed files with 16 additions and 2 deletions
|
|
@ -187,11 +187,17 @@ mod toast {
|
||||||
Secondary,
|
Secondary,
|
||||||
Success,
|
Success,
|
||||||
Danger,
|
Danger,
|
||||||
|
Warning,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Status {
|
impl Status {
|
||||||
pub const ALL: &'static [Self] =
|
pub const ALL: &'static [Self] = &[
|
||||||
&[Self::Primary, Self::Secondary, Self::Success, Self::Danger];
|
Self::Primary,
|
||||||
|
Self::Secondary,
|
||||||
|
Self::Success,
|
||||||
|
Self::Danger,
|
||||||
|
Self::Warning,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for Status {
|
impl fmt::Display for Status {
|
||||||
|
|
@ -201,6 +207,7 @@ mod toast {
|
||||||
Status::Secondary => "Secondary",
|
Status::Secondary => "Secondary",
|
||||||
Status::Success => "Success",
|
Status::Success => "Success",
|
||||||
Status::Danger => "Danger",
|
Status::Danger => "Danger",
|
||||||
|
Status::Warning => "Warning",
|
||||||
}
|
}
|
||||||
.fmt(f)
|
.fmt(f)
|
||||||
}
|
}
|
||||||
|
|
@ -251,6 +258,7 @@ mod toast {
|
||||||
Status::Secondary => secondary,
|
Status::Secondary => secondary,
|
||||||
Status::Success => success,
|
Status::Success => success,
|
||||||
Status::Danger => danger,
|
Status::Danger => danger,
|
||||||
|
Status::Warning => warning,
|
||||||
}),
|
}),
|
||||||
rule::horizontal(1),
|
rule::horizontal(1),
|
||||||
container(text(toast.body.as_str()))
|
container(text(toast.body.as_str()))
|
||||||
|
|
@ -664,4 +672,10 @@ mod toast {
|
||||||
|
|
||||||
styled(palette.danger.weak)
|
styled(palette.danger.weak)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn warning(theme: &Theme) -> container::Style {
|
||||||
|
let palette = theme.extended_palette();
|
||||||
|
|
||||||
|
styled(palette.warning.weak)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue