Revert changes in `tour` example

This commit is contained in:
Héctor Ramón 2021-06-10 18:47:39 +07:00
parent d46dd67a91
commit d1797dda87
1 changed files with 8 additions and 12 deletions

View File

@ -70,15 +70,13 @@ impl Sandbox for Tour {
controls = controls.push(Space::with_width(Length::Fill)); controls = controls.push(Space::with_width(Length::Fill));
let mut button = button(next_button, "Next"); if steps.can_continue() {
button = if steps.can_continue() { controls = controls.push(
button button(next_button, "Next")
.style(style::Button::Primary) .on_press(Message::NextPressed)
.on_press(Message::NextPressed) .style(style::Button::Primary),
} else { );
button.style(style::Button::Disabled) }
};
controls = controls.push(button);
let content: Element<_> = Column::new() let content: Element<_> = Column::new()
.max_width(540) .max_width(540)
@ -792,7 +790,6 @@ mod style {
pub enum Button { pub enum Button {
Primary, Primary,
Secondary, Secondary,
Disabled,
} }
impl button::StyleSheet for Button { impl button::StyleSheet for Button {
@ -800,8 +797,7 @@ mod style {
button::Style { button::Style {
background: Some(Background::Color(match self { background: Some(Background::Color(match self {
Button::Primary => Color::from_rgb(0.11, 0.42, 0.87), Button::Primary => Color::from_rgb(0.11, 0.42, 0.87),
Button::Secondary => Color::from_rgb(0.055, 0.21, 0.435), Button::Secondary => Color::from_rgb(0.5, 0.5, 0.5),
Button::Disabled => Color::from_rgb(0.5, 0.5, 0.5),
})), })),
border_radius: 12.0, border_radius: 12.0,
shadow_offset: Vector::new(1.0, 1.0), shadow_offset: Vector::new(1.0, 1.0),