From 51a0e99097f9ecb63eeb7f2ea7c38089977eb4d0 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 31 Oct 2019 03:50:40 +0100 Subject: Implement cursor movement in `TextInput` --- examples/todos.rs | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'examples/todos.rs') diff --git a/examples/todos.rs b/examples/todos.rs index 6189c8db..9581262a 100644 --- a/examples/todos.rs +++ b/examples/todos.rs @@ -15,26 +15,6 @@ struct Todos { tasks: Vec, } -#[derive(Debug)] -struct Task { - description: String, - completed: bool, -} - -impl Task { - fn new(description: String) -> Self { - Task { - description, - completed: false, - } - } - - fn view(&mut self) -> Element { - Checkbox::new(self.completed, &self.description, |checked| checked) - .into() - } -} - #[derive(Debug, Clone)] pub enum Message { InputChanged(String), @@ -107,6 +87,26 @@ impl Application for Todos { } } +#[derive(Debug)] +struct Task { + description: String, + completed: bool, +} + +impl Task { + fn new(description: String) -> Self { + Task { + description, + completed: false, + } + } + + fn view(&mut self) -> Element { + Checkbox::new(self.completed, &self.description, |checked| checked) + .into() + } +} + // Colors const GRAY: Color = Color { r: 0.5, -- cgit