summaryrefslogtreecommitdiffstats
path: root/examples/todos
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-02-01 13:51:11 +0100
committerLibravatar GitHub <noreply@github.com>2024-02-01 13:51:11 +0100
commit759f0e922598504705b543185bc7140a652b726a (patch)
treea7f2eb4ddee8127ace2e7002091c502d22bbb1c6 /examples/todos
parentb95f3ab12f863f4de668e4e6f8a75b7d3acdf2b7 (diff)
parentb0d40d70a041ffaa07d94bea8fba11589c239725 (diff)
downloadiced-759f0e922598504705b543185bc7140a652b726a.tar.gz
iced-759f0e922598504705b543185bc7140a652b726a.tar.bz2
iced-759f0e922598504705b543185bc7140a652b726a.zip
Merge pull request #2109 from avsaase/feat/checkbox-disabled
Add option to disable checkbox
Diffstat (limited to 'examples/todos')
-rw-r--r--examples/todos/src/main.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs
index 3d79f087..88c4c2b4 100644
--- a/examples/todos/src/main.rs
+++ b/examples/todos/src/main.rs
@@ -352,13 +352,10 @@ impl Task {
fn view(&self, i: usize) -> Element<TaskMessage> {
match &self.state {
TaskState::Idle => {
- let checkbox = checkbox(
- &self.description,
- self.completed,
- TaskMessage::Completed,
- )
- .width(Length::Fill)
- .text_shaping(text::Shaping::Advanced);
+ let checkbox = checkbox(&self.description, self.completed)
+ .on_toggle(TaskMessage::Completed)
+ .width(Length::Fill)
+ .text_shaping(text::Shaping::Advanced);
row![
checkbox,