Commit graph

79 commits

Author SHA1 Message Date
Héctor Ramón Jiménez
fd1101bd5f
Unify Program definition in iced_program subcrate 2025-03-12 02:10:42 +01:00
Héctor Ramón Jiménez
91af1c5ed6
Update all examples to Rust 2024 2025-02-21 01:37:14 +01:00
Héctor Ramón Jiménez
f3ae4266e9
Implement From<u32> instead of u16 for Length and Pixels 2025-02-09 06:38:48 +01:00
Héctor Ramón Jiménez
2b8b3fd413
Fix consistency of import ordering 2025-01-06 23:00:21 +01:00
Tommy Volk
0e8c3fe30f
chore: remove once_cell dependency 2025-01-06 22:56:48 +01:00
Héctor Ramón Jiménez
b518e30610
Fix Scrollable::spacing not embedding the Scrollbar 2024-07-16 19:05:46 +02:00
Héctor Ramón Jiménez
3f480d3d18
Rename embed_* in Scrollable to simply spacing 2024-07-12 20:00:14 +02:00
Héctor Ramón Jiménez
7c3341760d
Improve Padding ergonomics
We expose free functions for creating a `Padding`
and methods with the same name to modify its fields.
2024-07-12 18:43:25 +02:00
Héctor Ramón Jiménez
76737351ea
Re-export variants of Length and alignment types 2024-07-12 18:12:34 +02:00
Héctor Ramón Jiménez
f9dd5cbb09
Introduce helper methods for alignment for all widgets 2024-07-12 15:14:43 +02:00
Héctor Ramón Jiménez
8ae4e09db9
Add support for embedded scrollbars for scrollable
Co-authored-by: dtzxporter <dtzxporter@users.noreply.github.com>
2024-07-11 08:00:58 +02:00
Héctor Ramón Jiménez
341c9a3c12
Introduce daemon API and unify shell runtimes 2024-06-19 01:53:40 +02:00
Héctor Ramón Jiménez
a25b1af456
Replace Command with a new Task API with chain support 2024-06-14 01:47:39 +02:00
Héctor Ramón Jiménez
15057a05c1
Introduce center widget helper
... and also make `center_x` and `center_y` set
`width` and `height` to `Length::Fill`, respectively.

This targets the most common use case when centering
things and removes a bunch of boilerplate as a result.
2024-05-03 09:11:46 +02:00
Héctor Ramón Jiménez
f0ae9a0c38
Use Catalog approach for all widgets 2024-03-24 05:03:09 +01:00
Héctor Ramón Jiménez
54f44754eb
Move Program to application module 2024-03-17 14:19:12 +01:00
Héctor Ramón Jiménez
93ae790da1
Implement Program::load to specify startup Command 2024-03-16 15:54:37 +01:00
Héctor Ramón Jiménez
c22269bff3
Introduce Program API 2024-03-16 05:33:47 +01:00
Héctor Ramón Jiménez
5824ceb1fe
Simplify theming for ProgressBar widget 2024-03-05 22:13:55 +01:00
Héctor Ramón Jiménez
7d3735f0fa
Assert scrollable content size never fills scrolling axis 2024-02-24 19:46:44 +01:00
Héctor Ramón Jiménez
e8049af23d
Make horizontal_space and vertical_space fill by default 2024-02-15 02:08:22 +01:00
Héctor Ramón Jiménez
0eaaeaa517
Simplify scrollable styling API 2024-02-12 19:24:09 +01:00
dtzxporter
0f920e0435
Introduce an appearance for a scrollable, ability to customize the scrollbar gap.
Update scrollable.rs
2024-02-12 19:03:32 +01:00
Héctor Ramón Jiménez
25f182f933
Introduce Border struct analogous to Shadow 2024-01-20 13:29:25 +01:00
Héctor Ramón Jiménez
d24e50c1a6
Reduce padding of scrollable example 2024-01-10 10:01:49 +01:00
Héctor Ramón Jiménez
22226394f7
Introduce Widget::size_hint and fix further layout inconsistencies 2024-01-10 10:01:49 +01:00
Héctor Ramón Jiménez
0655a20ad1
Make Shrink have priority over Fill in layout 2024-01-04 06:51:21 +01:00
Héctor Ramón Jiménez
42ed90bc6f
Fix clippy::default_trait_access 2023-09-20 04:51:08 +02:00
Héctor Ramón Jiménez
bebb2b0252
Fix styling of horizontal scrollbar in scrollable example 2023-09-14 19:37:15 +02:00
Héctor Ramón Jiménez
f468e25d0c
Use workspace dependencies and package inheritance
We are also taking this as a chance to synchronize
the versions of all the crates! Because of this, we
will skip the `0.11` version.
2023-09-04 13:08:17 +02:00
Cory Forsstrom
4f066b516b Add scrollable alignment option 2023-07-04 10:43:12 -07:00
Héctor Ramón Jiménez
493571695a
Rename ScrollbarProperties to Direction in scrollable 2023-06-27 23:04:49 +02:00
Austin M. Reppert
fa04f40524
Make vertical scroll properties optional
Co-Authored-By: Austin M. Reppert <austinmreppert@gmail.com>
2023-06-27 23:03:29 +02:00
Casper Storm
25804d9e5a clean up rebase mistake 2023-05-23 19:42:01 +02:00
Casper Storm
1c86defab5 Extend border radius on relevant widgets 2023-05-23 14:50:29 +02:00
Marien Zwart
d20493c8a0
Support conversion from Fn trait to custom theme
...instead of just from function pointers.

I'm making this change not because I actually want to pass a closure,
but to make passing a single fixed function work. This commit also
simplifies the scrollable example slightly, and without the other half
of this change that simplified example fails to compile with:

```
error[E0277]: the trait bound `iced::theme::ProgressBar: From<for<'a> fn(&'a Theme) -> iced::widget::progress_bar::Appearance {progress_bar_custom_style}>` is not satisfied
   --> examples/scrollable/src/main.rs:292:28
    |
292 |                     .style(progress_bar_custom_style)
    |                      ----- ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<for<'a> fn(&'a Theme) -> iced::widget::progress_bar::Appearance {progress_bar_custom_style}>` is not implemented for `iced::theme::ProgressBar`
    |                      |
    |                      required by a bound introduced by this call
    |
    = help: the trait `From<for<'a> fn(&'a Theme) -> iced::widget::progress_bar::Appearance>` is implemented for `iced::theme::ProgressBar`
    = note: required for `for<'a> fn(&'a Theme) -> iced::widget::progress_bar::Appearance {progress_bar_custom_style}` to implement `Into<iced::theme::ProgressBar>`
note: required by a bound in `iced::widget::ProgressBar::<Renderer>::style`
   --> /home/marienz/src/iced/widget/src/progress_bar.rs:77:21
    |
77  |         style: impl Into<<Renderer::Theme as StyleSheet>::Style>,
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `ProgressBar::<Renderer>::style`
```

This happens because `progress_bar_custom_style` by itself is a function
item, which is typically coerced to a function pointer when one is
needed, but not in this case. It is possible to work around this on the
caller's side, but especially since the compiler diagnostic for this is
a bit rough (see https://github.com/rust-lang/rust/issues/100116) let's
try to make it work out of the box.
2023-05-21 23:41:26 +10:00
Cory Forsstrom
6ad5e03d71
Add scrollable Viewport 2023-04-17 13:55:40 -07:00
Cory Forsstrom
b623f280ed
Add scroll_to operation for absolute scroll 2023-04-14 13:32:44 -07:00
Héctor Ramón
4e409bb383
Merge pull request #1669 from GyulyVGC/master
Added scrollable style `focused` to be displayed when mouse is over the scrollable area
2023-03-27 16:17:02 +02:00
Héctor Ramón Jiménez
c407b4504c
Introduce is_mouse_over_scrollbar to StyleSheet::hovered for Scrollable 2023-03-27 15:51:32 +02:00
Héctor Ramón Jiménez
9e815cb749
Remove Fill variant for Alignment
Implementing this generically in our `flex` logic has an exponential
cost. Let's explore other options!
2023-02-27 16:54:28 +01:00
Héctor Ramón Jiménez
7b8b01f560
Use f32 in Length::Units and rename it to Fixed 2023-02-17 15:40:17 +01:00
Héctor Ramón Jiménez
0c2bcecd44
Add some missing spacing to scrollable example 2023-01-08 20:09:47 +01:00
Héctor Ramón Jiménez
624a4ada79
Introduce RelativeOffset type in scrollable 2023-01-08 20:07:11 +01:00
bungoboingo
9f85e0c721 Reworked Scrollable to account for lack of widget order guarantees.
Fixed thumb "snapping" bug on scrollable when cursor is out of bounds.
2022-12-29 18:29:15 -08:00
Bingus
d91f4f6aa7 Add multidirectional scrolling capabilities to the existing Scrollable. 2022-12-29 10:21:23 -08:00
Héctor Ramón Jiménez
df78777675
Box Custom in Theme 2022-11-03 03:27:55 +01:00
Héctor Ramón Jiménez
f04336dd5c
Remove unnecessary clone in scrollable example 2022-11-03 03:26:10 +01:00
Héctor Ramón Jiménez
3517dece26
Run cargo fmt 2022-11-03 03:25:27 +01:00
Ashley Wulber
4f3215f48e
fix: clippy lint https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant 2022-11-03 03:23:36 +01:00