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
|
||||
compact: Option<bool>,
|
||||
outline: Option<bool>,
|
||||
variant: Option<ButtonVariant>,
|
||||
size: Option<Size>,
|
||||
rounded: ButtonRounded,
|
||||
|
|
@ -35,6 +36,7 @@ impl DropdownButton {
|
|||
popup_menu: None,
|
||||
|
||||
compact: None,
|
||||
outline: None,
|
||||
variant: None,
|
||||
size: None,
|
||||
rounded: ButtonRounded::Medium,
|
||||
|
|
@ -63,6 +65,11 @@ impl DropdownButton {
|
|||
self.compact = Some(true);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn outline(mut self) -> Self {
|
||||
self.outline = Some(true);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl Styled for DropdownButton {
|
||||
|
|
@ -104,6 +111,7 @@ impl RenderOnce for DropdownButton {
|
|||
bottom: true,
|
||||
})
|
||||
.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.variant, |this, variant| this.with_variant(variant)),
|
||||
)
|
||||
|
|
@ -125,6 +133,7 @@ impl RenderOnce for DropdownButton {
|
|||
bottom_right: true,
|
||||
})
|
||||
.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.variant, |this, variant| this.with_variant(variant))
|
||||
.popup_menu_with_anchor(Corner::TopRight, move |this, window, cx| {
|
||||
|
|
|
|||
Loading…
Reference in a new issue