summaryrefslogtreecommitdiffstats
path: root/examples/todos
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-01-21 00:15:01 +0100
committerLibravatar GitHub <noreply@github.com>2020-01-21 00:15:01 +0100
commit7016221556ea8183ebcd8ef8df00044e2eda71e7 (patch)
treebc1609b71b88437fc7497af339b6427f63121c76 /examples/todos
parent6ca5e6184f9f1c12b427bdafcce0b4e9fbc5bb14 (diff)
parent91d9d65a03ce9b211e4043726e7424949d314325 (diff)
downloadiced-7016221556ea8183ebcd8ef8df00044e2eda71e7.tar.gz
iced-7016221556ea8183ebcd8ef8df00044e2eda71e7.tar.bz2
iced-7016221556ea8183ebcd8ef8df00044e2eda71e7.zip
Merge pull request #164 from hecrj/feature/custom-runtime
Custom futures executor with `iced_futures`
Diffstat (limited to '')
-rw-r--r--examples/todos/Cargo.toml16
-rw-r--r--examples/todos/README.md20
-rw-r--r--examples/todos/fonts/icons.ttf (renamed from examples/resources/icons.ttf)bin5596 -> 5596 bytes
-rw-r--r--examples/todos/src/main.rs (renamed from examples/todos.rs)3
4 files changed, 38 insertions, 1 deletions
diff --git a/examples/todos/Cargo.toml b/examples/todos/Cargo.toml
new file mode 100644
index 00000000..53a135e6
--- /dev/null
+++ b/examples/todos/Cargo.toml
@@ -0,0 +1,16 @@
+[package]
+name = "todos"
+version = "0.1.0"
+authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
+edition = "2018"
+publish = false
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+iced = { path = "../.." }
+iced_futures = { path = "../../futures", features = ["async-std"] }
+async-std = "1.0"
+serde = { version = "1.0", features = ["derive"] }
+serde_json = "1.0"
+directories = "2.0"
diff --git a/examples/todos/README.md b/examples/todos/README.md
new file mode 100644
index 00000000..9c2598b9
--- /dev/null
+++ b/examples/todos/README.md
@@ -0,0 +1,20 @@
+## Todos
+
+A todos tracker inspired by [TodoMVC]. It showcases dynamic layout, text input, checkboxes, scrollables, icons, and async actions! It automatically saves your tasks in the background, even if you did not finish typing them.
+
+All the example code is located in the __[`main`]__ file.
+
+<div align="center">
+ <a href="https://gfycat.com/littlesanehalicore">
+ <img src="https://thumbs.gfycat.com/LittleSaneHalicore-small.gif" height="400px">
+ </a>
+</div>
+
+You can run the native version with `cargo run`:
+```
+cargo run --package todos
+```
+We have not yet implemented a `LocalStorage` version of the auto-save feature. Therefore, it does not work on web _yet_!
+
+[`main`]: src/main.rs
+[TodoMVC]: http://todomvc.com/
diff --git a/examples/resources/icons.ttf b/examples/todos/fonts/icons.ttf
index 4498299d..4498299d 100644
--- a/examples/resources/icons.ttf
+++ b/examples/todos/fonts/icons.ttf
Binary files differ
diff --git a/examples/todos.rs b/examples/todos/src/main.rs
index 4166f75a..c6ddf2ea 100644
--- a/examples/todos.rs
+++ b/examples/todos/src/main.rs
@@ -38,6 +38,7 @@ enum Message {
}
impl Application for Todos {
+ type Executor = iced_futures::executor::AsyncStd;
type Message = Message;
fn new() -> (Todos, Command<Message>) {
@@ -450,7 +451,7 @@ fn empty_message(message: &str) -> Element<'static, Message> {
// Fonts
const ICONS: Font = Font::External {
name: "Icons",
- bytes: include_bytes!("resources/icons.ttf"),
+ bytes: include_bytes!("../fonts/icons.ttf"),
};
fn icon(unicode: char) -> Text {