Introduce support for disabling a checkbox

This commit is contained in:
Alexander van Saase 2023-10-02 20:18:15 +02:00 committed by Héctor Ramón Jiménez
parent b95f3ab12f
commit b5f1ca1695
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
14 changed files with 166 additions and 85 deletions

View file

@ -554,11 +554,13 @@ impl<'a> Step {
.width(Length::Fill)
.horizontal_alignment(alignment::Horizontal::Center),
)
.push(checkbox(
"Use nearest interpolation",
filter_method == image::FilterMethod::Nearest,
StepMessage::ImageUseNearestToggled,
))
.push(
checkbox(
"Use nearest interpolation",
filter_method == image::FilterMethod::Nearest,
)
.on_toggle(StepMessage::ImageUseNearestToggled),
)
.align_items(Alignment::Center)
}
@ -616,16 +618,14 @@ impl<'a> Step {
} else {
text_input
})
.push(checkbox(
"Enable password mode",
is_secure,
StepMessage::ToggleSecureInput,
))
.push(checkbox(
"Show icon",
is_showing_icon,
StepMessage::ToggleTextInputIcon,
))
.push(
checkbox("Enable password mode", is_secure)
.on_toggle(StepMessage::ToggleSecureInput),
)
.push(
checkbox("Show icon", is_showing_icon)
.on_toggle(StepMessage::ToggleTextInputIcon),
)
.push(
"A text input produces a message every time it changes. It is \
very easy to keep track of its contents:",
@ -658,7 +658,8 @@ impl<'a> Step {
.horizontal_alignment(alignment::Horizontal::Center),
)
} else {
checkbox("Explain layout", debug, StepMessage::DebugToggled)
checkbox("Explain layout", debug)
.on_toggle(StepMessage::DebugToggled)
.into()
})
.push("Feel free to go back and take a look.")