1
- # druid
1
+ # Druid
2
2
3
3
## A data-first Rust-native UI toolkit.
4
4
@@ -15,11 +15,11 @@ See the [goals section](#Goals) for more details.
15
15
Druid's current development is largely driven by its use in [ Runebender] , a new
16
16
font editor.
17
17
18
- We have been doing periodic releases of druid on crates.io, but it is under
18
+ We have been doing periodic releases of Druid on crates.io, but it is under
19
19
active development and its API might change. All changes are documented
20
20
in [ the changelog] ( https://github.com/linebender/druid/blob/master/CHANGELOG.md ) .
21
21
22
- For an overview of some key concepts, see the (work in progress) [ druid book] .
22
+ For an overview of some key concepts, see the (work in progress) [ Druid book] .
23
23
24
24
## Example
25
25
@@ -55,7 +55,7 @@ fn ui_builder() -> impl Widget<u32> {
55
55
```
56
56
57
57
Check out the [ the examples folder] for a more comprehensive demonstration of
58
- druid 's existing functionality and widgets.
58
+ Druid 's existing functionality and widgets.
59
59
60
60
## Screenshots
61
61
@@ -85,7 +85,7 @@ platforms. In order to achieve this we strive for a variety of things:
85
85
86
86
In order to fulfill those goals, we cannot support every use case. Luckily
87
87
the Rust community is working on a variety of different libraries with
88
- different goals, so here are some of druid 's non-goals and possible
88
+ different goals, so here are some of Druid 's non-goals and possible
89
89
alternatives that can offer those capabilities:
90
90
91
91
- Use the the platform-native widgets or mimic them. ([ Relm] )
@@ -100,22 +100,22 @@ doesn't suit your use case, perhaps one of the others will!
100
100
101
101
### druid-shell
102
102
103
- The druid toolkit uses druid-shell for a platform-abstracting application shell.
104
- Druid -shell is responsible for starting a native platform runloop, listening to
103
+ The Druid toolkit uses ` druid-shell ` for a platform-abstracting application shell.
104
+ ` druid -shell` is responsible for starting a native platform runloop, listening to
105
105
events, converting them into a platform-agnostic representation, and calling a
106
106
user-provided handler with them.
107
107
108
- While druid-shell is being developed with the druid toolkit in mind, it is
108
+ While ` druid-shell ` is being developed with the Druid toolkit in mind, it is
109
109
intended to be general enough that it could be reused by other projects
110
- interested in experimenting with Rust GUI. The druid-shell crate includes a
111
- couple of [ non-druid examples] .
110
+ interested in experimenting with Rust GUI. The ` druid-shell ` crate includes a
111
+ couple of [ non-` druid ` examples] .
112
112
113
113
### piet
114
114
115
- Druid relies on the [ piet library] for drawing and text layout. Piet is a 2D graphics
115
+ Druid relies on the [ Piet library] for drawing and text layout. Piet is a 2D graphics
116
116
abstraction with multiple backends: ` piet-direct2d ` , ` piet-coregraphics ` , ` piet-cairo ` ,
117
117
` piet-web ` , and ` piet-svg ` are currently available, and a GPU backend is planned.
118
- In terms of druid platform support via piet , macOS uses ` piet-coregraphics ` ,
118
+ In terms of Druid platform support via Piet , macOS uses ` piet-coregraphics ` ,
119
119
Linux uses ` piet-cairo ` , Windows uses ` piet-direct2d ` , and web uses ` piet-web ` .
120
120
121
121
``` rust
@@ -144,7 +144,7 @@ ctx.fill(rect, &fill_color);
144
144
145
145
### widgets
146
146
147
- Widgets in druid (text boxes, buttons, layout components, etc.) are objects
147
+ Widgets in Druid (text boxes, buttons, layout components, etc.) are objects
148
148
which implement the [ Widget trait] . The trait is parametrized by a type (` T ` )
149
149
for associated data. All trait methods (` event ` , ` lifecycle ` , ` update ` , ` paint ` ,
150
150
and ` layout ` ) are provided with access to this data, and in the case of
@@ -201,7 +201,7 @@ fn build_widget() -> impl Widget<u32> {
201
201
### layout
202
202
203
203
Druid's layout protocol is strongly inspired by [ Flutter's box layout model] .
204
- In druid , widgets are passed a ` BoxConstraint ` that provides them a minimum and
204
+ In Druid , widgets are passed a ` BoxConstraint ` that provides them a minimum and
205
205
maximum size for layout. Widgets are also responsible for computing appropriate
206
206
constraints for their children if applicable.
207
207
@@ -250,18 +250,18 @@ LensWrap::new(WidgetThatExpectsf64::new(), lens!(AppState, value));
250
250
251
251
This is particularly useful when working with types defined in another crate.
252
252
253
- ## Using druid
253
+ ## Using Druid
254
254
255
- An explicit goal of druid is to be easy to build, so please open an issue if you
255
+ An explicit goal of Druid is to be easy to build, so please open an issue if you
256
256
run into any difficulties. Druid is available on [ crates.io] and should work as
257
- a lone dependency (it re-exports all the parts of druid-shell, piet, and kurbo
257
+ a lone dependency (it re-exports all the parts of ` druid-shell ` , piet, and kurbo
258
258
that you'll need):
259
259
260
260
``` toml
261
261
druid = " 0.6.0"
262
262
```
263
263
264
- Since druid is currently in fast-evolving state, you might prefer to drink from
264
+ Since Druid is currently in fast-evolving state, you might prefer to drink from
265
265
the firehose:
266
266
267
267
``` toml
@@ -272,7 +272,7 @@ druid = { git = "https://github.com/linebender/druid.git" }
272
272
273
273
#### Linux
274
274
275
- On Linux, druid requires gtk+3; see [ gtk-rs dependencies] for installation
275
+ On Linux, Druid requires gtk+3; see [ gtk-rs dependencies] for installation
276
276
instructions.
277
277
278
278
Alternatively, there is an X11 backend available, although it is currently
@@ -294,7 +294,7 @@ active and friendly community.
294
294
295
295
[ Runebender ] : https://github.com/linebender/runebender
296
296
[ the examples folder ] : ./druid/examples
297
- [ piet library] : https://github.com/linebender/piet
297
+ [ Piet library] : https://github.com/linebender/piet
298
298
[ custom_widget ] : ./druid/examples/custom_widget.rs
299
299
[ basic utility and layout widgets ] : ./druid/src/widget
300
300
[ Flutter's box layout model ] : https://api.flutter.dev/flutter/rendering/BoxConstraints-class.html
@@ -303,7 +303,7 @@ active and friendly community.
303
303
[ Rust-native GUI experiments ] : https://areweguiyet.com
304
304
[ CONTRIBUTING.md ] : ./CONTRIBUTING.md
305
305
[ Zulip chat instance ] : https://xi.zulipchat.com
306
- [ non-druid examples ] : ./druid-shell/examples/shello.rs
306
+ [ non-` druid` examples ] : ./druid-shell/examples/shello.rs
307
307
[ crates.io ] : https://crates.io/crates/druid
308
308
[ EventCtx ] : https://docs.rs/druid/0.6.0/druid/struct.EventCtx.html
309
309
[ LifeCycleCtx ] : https://docs.rs/druid/0.6.0/druid/struct.EventCtx.html
@@ -313,7 +313,7 @@ active and friendly community.
313
313
[ Widget trait ] : https://docs.rs/druid/0.6.0/druid/trait.Widget.html
314
314
[ Data trait ] : https://docs.rs/druid/0.6.0/druid/trait.Data.html
315
315
[ Lens datatype ] : https://docs.rs/druid/0.6.0/druid/trait.Lens.html
316
- [ druid book] : https://linebender.org/druid/
316
+ [ Druid book] : https://linebender.org/druid/
317
317
[ Iced ] : https://github.com/hecrj/iced
318
318
[ Conrod ] : https://github.com/PistonDevelopers/conrod
319
319
[ Relm ] : https://github.com/antoyo/relm
0 commit comments