Commit graph

2567 commits

Author SHA1 Message Date
Héctor Ramón
9fe5080153
Merge pull request #1219 from Alch-Emi/image-modes
ContentFit support for images
2022-02-23 16:56:01 +07:00
Héctor Ramón Jiménez
33b9b50883
Showcase only Contain, Cover, and Fill image modes in tour 2022-02-23 16:32:12 +07:00
Héctor Ramón
e0185b8cda
Merge pull request #1262 from nicksenger/fix/overlay-layouts
Fix: overlay layout for `Responsive`
2022-02-23 15:58:39 +07:00
Nick Senger
a12a92c266
fix: overlay layout for Responsive 2022-02-22 23:38:32 +07:00
Héctor Ramón Jiménez
820d332736
Fix subscription for iced::pure::Application 2022-02-20 13:09:47 +07:00
Héctor Ramón Jiménez
9b23ea698e
Implement pure version of component example 2022-02-17 19:09:26 +07:00
Héctor Ramón Jiménez
da45b6c162
Implement pure::Component in iced_lazy 2022-02-17 19:08:54 +07:00
Héctor Ramón Jiménez
6f6ce15a20
Keep using Ferris in the image section of the tour
Wide ferris is cute :3
2022-02-16 18:19:37 +07:00
Héctor Ramón Jiménez
15b4bbd49d
Hash content_fit in hash_layout of Image and Svg 2022-02-16 18:19:37 +07:00
Héctor Ramón Jiménez
8d94cd4c5c
Remove redundant layout.bounds() calls in Image and Svg 2022-02-16 18:19:37 +07:00
Héctor Ramón Jiménez
83c0e0f7a8
Add ContentFit support to Svg widget 2022-02-16 18:19:37 +07:00
Héctor Ramón Jiménez
c910e23919
Expose ContentFit in root 2022-02-16 18:19:37 +07:00
Héctor Ramón Jiménez
6822d1d9f2
Center Image inside available bounds when possible 2022-02-16 18:19:37 +07:00
Héctor Ramón Jiménez
0aff444941
Rename Image::fit to content_fit
... just for consistency!
2022-02-16 18:19:37 +07:00
Héctor Ramón Jiménez
8b5c9dfa71
Make documentation of Image::fit consistent 2022-02-16 18:19:37 +07:00
Héctor Ramón Jiménez
395eacfc10
Use a new clipping layer only when necessary in Image::draw 2022-02-16 18:19:36 +07:00
Héctor Ramón Jiménez
c6486978de
Rename image module to content_fit in iced_core
Since we are just exposing the `ContentFit` type and not the module `image` at all.
2022-02-16 18:19:36 +07:00
Emi Simpson
ca1fcdaf14
Add support for ContentFit for Image 2022-02-16 18:19:33 +07:00
Héctor Ramón Jiménez
2737b21d34
Implement pure version of pick_list example 🎉 2022-02-16 17:16:34 +07:00
Héctor Ramón Jiménez
0ca066277a
Fix overlay translation for Scrollable in iced_pure 2022-02-16 17:15:56 +07:00
Héctor Ramón Jiménez
6e242fe0e5
Add pick_list function helper in iced_pure::widget 2022-02-16 17:15:43 +07:00
Héctor Ramón Jiménez
019af8ddbf
Add overlay support in iced_pure and port PickList 🎉 2022-02-16 17:07:25 +07:00
Héctor Ramón Jiménez
35e9b75e41
Introduce Tag and State opaque types in iced_pure::widget::tree 2022-02-16 15:44:50 +07:00
Héctor Ramón Jiménez
cff891833b
Implement pure version of the tour example 🎉 2022-02-13 22:19:43 +07:00
Héctor Ramón Jiménez
6689ede6d8
Implement Space in iced_pure 2022-02-13 22:18:21 +07:00
Héctor Ramón Jiménez
53f3820432
Implement Radio in iced_pure 2022-02-13 22:13:47 +07:00
Héctor Ramón Jiménez
e50e639b0e
Expose additional helpers in iced::pure 2022-02-13 19:23:51 +07:00
Héctor Ramón Jiménez
98750782f3
Introduce lifetime to on_change handler for Toggler 2022-02-13 19:23:15 +07:00
Héctor Ramón Jiménez
0fec0a2b77
Implement Toggler in iced_pure 2022-02-13 19:01:09 +07:00
Héctor Ramón Jiménez
3f1a45ca47
Implement Slider in iced_pure 2022-02-13 17:20:10 +07:00
Héctor Ramón Jiménez
45455be450
Implement Image in iced_pure 2022-02-13 16:51:31 +07:00
Héctor Ramón Jiménez
09c96a6d81
Add max_width to Column in iced_pure 2022-02-12 18:02:29 +07:00
Héctor Ramón Jiménez
4c61601aa3
Implement missing on_event and mouse_interaction for Checkbox in iced_pure 2022-02-12 17:26:49 +07:00
Héctor Ramón Jiménez
bd22cc0bc0
Implement pure version of todos example 🎉
The `Widget` trait in `iced_pure` needed to change a bit to make the
implementation of `Element::map` possible.

Specifically, the `children` method has been split into `diff` and
`children_state`.
2022-02-12 17:21:28 +07:00
Héctor Ramón Jiménez
e3108494e5
Implement TextInput in iced_pure 2022-02-12 16:11:37 +07:00
Héctor Ramón Jiménez
b2670e8752
Implement Scrollable in iced_pure 2022-02-12 15:18:31 +07:00
Héctor Ramón Jiménez
178914ec23
Implement Checkbox in iced_pure 2022-02-12 14:26:17 +07:00
Héctor Ramón Jiménez
dee3dba632
Reuse Text widget from iced_native in iced_pure 2022-02-12 14:22:17 +07:00
Héctor Ramón Jiménez
182fb9446c
Implement Container widget in iced_pure 2022-02-12 14:07:04 +07:00
Héctor Ramón Jiménez
8b27083cda
Use TypeId of () for Column and Row tags in iced_pure 2022-02-11 23:40:24 +07:00
Héctor Ramón Jiménez
af122265f6
Implement Row in iced_pure 2022-02-11 23:39:41 +07:00
Héctor Ramón Jiménez
dd3e74e74d
Complete Button in iced_pure 2022-02-11 23:33:03 +07:00
Héctor Ramón Jiménez
ecb3df8e01
Expose reusable Button logic
... and reuse it in `iced_pure`!
2022-02-11 23:17:07 +07:00
Héctor Ramón Jiménez
01c5004959
Allow pure widgets to borrow from Application data 🎉 2022-02-11 22:07:21 +07:00
Héctor Ramón Jiménez
43a7ad72ef
Expose function helpers to build widgets in pure::widget
`button("Hello")` is easier to write and read than
`Button::new("Hello")`.
2022-02-11 18:42:15 +07:00
Héctor Ramón Jiménez
66d69b5c9a
Expose iced_pure through a pure feature in iced
Besides exposing the `iced_pure` crate, enabling the `pure` feature also
provides pure versions of both the `Application` and `Sandbox` traits!
🎉
2022-02-11 17:51:33 +07:00
Héctor Ramón Jiménez
897188317b
Rename iced_virtual to iced_pure
`virtual` is a reserved keyword in Rust 😬
2022-02-11 17:50:12 +07:00
Héctor Ramón Jiménez
e03de01988
Implement Into<Element> for &'static str in iced_virtual 2022-02-10 23:16:21 +07:00
Héctor Ramón Jiménez
5225e0e304
Draft virtual Button, Column, and Text
... as well as a very naive diffing strategy!
2022-02-10 21:54:13 +07:00
Héctor Ramón Jiménez
8f0839e786
Draft iced_virtual subcrate
The idea here is to expose a set of "virtual widgets" that can be used with a
`Virtual` widget and its `virtual::State`.

A virtual widget is a widget that does not contain any state, but instead is a
"virtual" representation of the "real" widget. The real widgets are stored in
the `virtual::State`.

Every time a new virtual widget tree is created during `view`, it is compared to
the previous one and "real" widgets are added / removed to the `virtual::State`.

Effectively, this removes the need to keep track of local widget state in the
application state and allows `view` to take an immutable reference to `self`.

To summarize, using this crate should allow users to remove `State` structs
in their application state.

Eventually, the strategy used here may be adopted generally and, as a result,
all of the widgets in `iced_native` would be replaced!
2022-02-09 19:42:15 +07:00