dropdown_button: Support outline style (#716)
This commit is contained in:
parent
87b8958059
commit
8e7ef5631e
1 changed files with 9 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ pub struct DropdownButton {
|
||||||
|
|
||||||
// The button props
|
// The button props
|
||||||
compact: Option<bool>,
|
compact: Option<bool>,
|
||||||
|
outline: Option<bool>,
|
||||||
variant: Option<ButtonVariant>,
|
variant: Option<ButtonVariant>,
|
||||||
size: Option<Size>,
|
size: Option<Size>,
|
||||||
rounded: ButtonRounded,
|
rounded: ButtonRounded,
|
||||||
|
|
@ -35,6 +36,7 @@ impl DropdownButton {
|
||||||
popup_menu: None,
|
popup_menu: None,
|
||||||
|
|
||||||
compact: None,
|
compact: None,
|
||||||
|
outline: None,
|
||||||
variant: None,
|
variant: None,
|
||||||
size: None,
|
size: None,
|
||||||
rounded: ButtonRounded::Medium,
|
rounded: ButtonRounded::Medium,
|
||||||
|
|
@ -63,6 +65,11 @@ impl DropdownButton {
|
||||||
self.compact = Some(true);
|
self.compact = Some(true);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn outline(mut self) -> Self {
|
||||||
|
self.outline = Some(true);
|
||||||
|
self
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Styled for DropdownButton {
|
impl Styled for DropdownButton {
|
||||||
|
|
@ -104,6 +111,7 @@ impl RenderOnce for DropdownButton {
|
||||||
bottom: true,
|
bottom: true,
|
||||||
})
|
})
|
||||||
.when_some(self.compact, |this, _| this.compact())
|
.when_some(self.compact, |this, _| this.compact())
|
||||||
|
.when_some(self.outline, |this, _| this.outline())
|
||||||
.when_some(self.size, |this, size| this.with_size(size))
|
.when_some(self.size, |this, size| this.with_size(size))
|
||||||
.when_some(self.variant, |this, variant| this.with_variant(variant)),
|
.when_some(self.variant, |this, variant| this.with_variant(variant)),
|
||||||
)
|
)
|
||||||
|
|
@ -125,6 +133,7 @@ impl RenderOnce for DropdownButton {
|
||||||
bottom_right: true,
|
bottom_right: true,
|
||||||
})
|
})
|
||||||
.when_some(self.compact, |this, _| this.compact())
|
.when_some(self.compact, |this, _| this.compact())
|
||||||
|
.when_some(self.outline, |this, _| this.outline())
|
||||||
.when_some(self.size, |this, size| this.with_size(size))
|
.when_some(self.size, |this, size| this.with_size(size))
|
||||||
.when_some(self.variant, |this, variant| this.with_variant(variant))
|
.when_some(self.variant, |this, variant| this.with_variant(variant))
|
||||||
.popup_menu_with_anchor(Corner::TopRight, move |this, window, cx| {
|
.popup_menu_with_anchor(Corner::TopRight, move |this, window, cx| {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue