Update README

This commit is contained in:
Héctor Ramón Jiménez 2019-08-25 19:46:41 +02:00
parent bdab6f9d1a
commit 880a101a35

View file

@ -6,7 +6,7 @@ Iced
[![License](https://img.shields.io/crates/l/iced.svg)](https://github.com/hecrj/iced/blob/master/LICENSE) [![License](https://img.shields.io/crates/l/iced.svg)](https://github.com/hecrj/iced/blob/master/LICENSE)
------------------- -------------------
A delightful GUI runtime for Rust, heavily inspired by Elm. A simple GUI runtime for Rust, heavily inspired by Elm.
__Iced is in a very early stage of development.__ Many [basic features are still __Iced is in a very early stage of development.__ Many [basic features are still
missing] and there are probably _many_ bugs. [Feel free to contribute!] missing] and there are probably _many_ bugs. [Feel free to contribute!]
@ -23,7 +23,7 @@ missing] and there are probably _many_ bugs. [Feel free to contribute!]
* Simple, easy-to-use, _macro-free_ API * Simple, easy-to-use, _macro-free_ API
* Responsive, flexbox-based layouting * Responsive, flexbox-based layouting
* Type-safe, reactive programming model * Type-safe, reactive programming model
* Built-in widgets: buttons, checkboxes, radios... * Many built-in widgets
* Custom widget support * Custom widget support
* Renderer-agnostic runtime * Renderer-agnostic runtime
@ -40,10 +40,8 @@ you want to learn about a specific release, check out [the release list].
[the release list]: https://github.com/hecrj/iced/releases [the release list]: https://github.com/hecrj/iced/releases
## Overview ## Overview
Iced is heavily inspired by [Elm] and [The Elm Architecture] and it expects you
Iced is heavily inspired by [Elm] and [The Elm Architecture]. to split user interfaces into four different concepts:
Basically, Iced expects you to split user interfaces into four different concepts:
* __State__ — the state of your application * __State__ — the state of your application
* __Messages__ — user interactions or meaningful events that you care * __Messages__ — user interactions or meaningful events that you care
@ -65,14 +63,14 @@ struct Counter {
// The counter value // The counter value
value: i32, value: i32,
// Local state of the two buttons // The local state of the two buttons
increment_button: button::State, increment_button: button::State,
decrement_button: button::State, decrement_button: button::State,
} }
``` ```
Simple enough! What are the user interactions we care about? The button Now that we have state, what are the user interactions we care about? The
presses! These are our __messages__: button presses! These are our __messages__:
```rust ```rust
#[derive(Debug, Clone, Copy)] #[derive(Debug, Clone, Copy)]
@ -82,7 +80,7 @@ pub enum Message {
} }
``` ```
Now, let's put it all together in our __view logic__: Next, let's put it all together in our __view logic__:
```rust ```rust
use iced::{Button, Column, Text}; use iced::{Button, Column, Text};
@ -131,7 +129,8 @@ impl Counter {
} }
``` ```
And that's it! We just wrote a whole user interface. Iced is now able to: And that's everything! We just wrote a whole user interface. Iced is now able
to:
1. Take the result of our __view logic__ and build a user interface. 1. Take the result of our __view logic__ and build a user interface.
1. Process events representing user interactions and produce __messages__ for 1. Process events representing user interactions and produce __messages__ for
@ -144,16 +143,15 @@ Browse the [documentation] and the [examples] to learn more!
[examples]: https://github.com/hecrj/iced/tree/master/examples [examples]: https://github.com/hecrj/iced/tree/master/examples
## Gallery ## Gallery
[![UI Tour - Coffee][gui_gif]][gui_gfycat] [![UI Tour - Coffee][gui_gif]][gui_gfycat]
[gui_gif]: https://thumbs.gfycat.com/GloomyWeakHammerheadshark-small.gif [gui_gif]: https://thumbs.gfycat.com/GloomyWeakHammerheadshark-small.gif
[gui_gfycat]: https://gfycat.com/gloomyweakhammerheadshark [gui_gfycat]: https://gfycat.com/gloomyweakhammerheadshark
## Implementation details ## Implementation details
Iced was originally born as part of [Coffee], my own 2D game engine, as Iced was originally born as part of [Coffee], a 2D game engine I am working on,
an attempt at bringing the simplicity of [Elm] and [The Elm Architecture] into as an attempt at bringing the simplicity of [Elm] and [The Elm Architecture]
Rust. into Rust.
Currently, Iced builds upon Currently, Iced builds upon
* [`stretch`] for flexbox-based layouting. * [`stretch`] for flexbox-based layouting.