Implement with_background for button::Appearance
This commit is contained in:
parent
e11776055d
commit
34ca5386b5
1 changed files with 10 additions and 0 deletions
|
|
@ -411,6 +411,16 @@ pub struct Appearance {
|
|||
pub shadow: Shadow,
|
||||
}
|
||||
|
||||
impl Appearance {
|
||||
/// Creates an [`Appearance`] with the given [`Background`].
|
||||
pub fn with_background(background: impl Into<Background>) -> Self {
|
||||
Self {
|
||||
background: Some(background.into()),
|
||||
..Self::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::default::Default for Appearance {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue