Redesign for the v1 stable release (#3)
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m26s
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m26s
Only half done. Will continue in another PR. Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
@@ -124,6 +124,7 @@ pub struct Button {
|
||||
children: Vec<AnyElement>,
|
||||
|
||||
variant: ButtonVariant,
|
||||
center: bool,
|
||||
rounded: bool,
|
||||
size: Size,
|
||||
|
||||
@@ -170,6 +171,7 @@ impl Button {
|
||||
on_hover: None,
|
||||
loading: false,
|
||||
reverse: false,
|
||||
center: true,
|
||||
bold: false,
|
||||
cta: false,
|
||||
children: Vec::new(),
|
||||
@@ -221,6 +223,12 @@ impl Button {
|
||||
self
|
||||
}
|
||||
|
||||
/// Disable centering the button's content.
|
||||
pub fn no_center(mut self) -> Self {
|
||||
self.center = false;
|
||||
self
|
||||
}
|
||||
|
||||
/// Set the cta style of the button.
|
||||
pub fn cta(mut self) -> Self {
|
||||
self.cta = true;
|
||||
@@ -353,7 +361,7 @@ impl RenderOnce for Button {
|
||||
.flex_shrink_0()
|
||||
.flex()
|
||||
.items_center()
|
||||
.justify_center()
|
||||
.when(self.center, |this| this.justify_center())
|
||||
.cursor_default()
|
||||
.overflow_hidden()
|
||||
.refine_style(&self.style)
|
||||
|
||||
Reference in New Issue
Block a user