summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--examples/editor/src/main.rs8
-rw-r--r--examples/styling/src/main.rs10
-rw-r--r--examples/tour/src/main.rs10
3 files changed, 12 insertions, 16 deletions
diff --git a/examples/editor/src/main.rs b/examples/editor/src/main.rs
index 068782ba..d55f9bdf 100644
--- a/examples/editor/src/main.rs
+++ b/examples/editor/src/main.rs
@@ -150,11 +150,9 @@ impl Editor {
self.is_dirty.then_some(Message::SaveFile)
),
horizontal_space(),
- toggler(
- Some("Word Wrap"),
- self.word_wrap,
- Message::WordWrapToggled
- ),
+ toggler(self.word_wrap)
+ .label("Word Wrap")
+ .on_toggle(Message::WordWrapToggled),
pick_list(
highlighter::Theme::ALL,
Some(self.theme),
diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs
index e19d5cf7..534f5e32 100644
--- a/examples/styling/src/main.rs
+++ b/examples/styling/src/main.rs
@@ -77,12 +77,10 @@ impl Styling {
let checkbox = checkbox("Check me!", self.checkbox_value)
.on_toggle(Message::CheckboxToggled);
- let toggler = toggler(
- Some("Toggle me!"),
- self.toggler_value,
- Message::TogglerToggled,
- )
- .spacing(10);
+ let toggler = toggler(self.toggler_value)
+ .label("Toggle me!")
+ .on_toggle(Message::TogglerToggled)
+ .spacing(10);
let content = column![
choose_theme,
diff --git a/examples/tour/src/main.rs b/examples/tour/src/main.rs
index 0dd588fe..d8c0b29a 100644
--- a/examples/tour/src/main.rs
+++ b/examples/tour/src/main.rs
@@ -357,11 +357,11 @@ impl Tour {
Self::container("Toggler")
.push("A toggler is mostly used to enable or disable something.")
.push(
- Container::new(toggler(
- Some("Toggle me to continue..."),
- self.toggler,
- Message::TogglerChanged,
- ))
+ Container::new(
+ toggler(self.toggler)
+ .label("Toggle me to continue...")
+ .on_toggle(Message::TogglerChanged),
+ )
.padding([0, 40]),
)
}