Commit graph

52 commits

Author SHA1 Message Date
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
Ashley Wulber
269d6f9a3f
fix: scrollable example 2022-11-03 03:23:35 +01:00
Héctor Ramón Jiménez
13dd1ca0a8
Implement scrollable::snap_to operation 2022-08-04 03:55:41 +02:00
Héctor Ramón Jiménez
c512d50e19
Fix clippy lints 2022-07-27 06:59:54 +02:00
Héctor Ramón Jiménez
ff2519b1d4
Replace stateful widgets with new iced_pure API 2022-07-27 06:49:20 +02:00
Héctor Ramón Jiménez
2933ac7355
Remove style module leftover in scrollable example 2022-06-07 03:28:41 +02:00
Héctor Ramón Jiménez
de21a651c0
Implement theme styling for Scrollable 2022-06-07 03:26:48 +02:00
Héctor Ramón Jiménez
ce53d3933c
Implement theme styling for TextInput 2022-06-07 01:11:35 +02:00
Héctor Ramón Jiménez
c275fde67a
Implement theme styling for Rule 2022-06-01 01:56:46 +02:00
Héctor Ramón Jiménez
28d09bfff1
Implement theme styling for Radio 2022-05-27 01:29:36 +02:00
Héctor Ramón Jiménez
adce9e0421
Update Rust edition to 2021 🎉 2022-02-09 17:57:44 +07:00
ImgBotApp
c70929bf2c
[ImgBot] Optimize images
*Total -- 967.49kb -> 703.99kb (27.24%)

/docs/images/radio.png -- 5.29kb -> 1.58kb (70.18%)
/docs/images/text_input.png -- 3.18kb -> 1.27kb (60.17%)
/docs/images/checkbox.png -- 5.56kb -> 2.22kb (60.17%)
/examples/color_palette/screenshot.png -- 102.74kb -> 43.75kb (57.42%)
/examples/tour/images/ferris.png -- 32.29kb -> 15.91kb (50.73%)
/docs/graphs/ecosystem.png -- 124.13kb -> 67.44kb (45.67%)
/docs/graphs/iced.png -- 97.75kb -> 53.27kb (45.5%)
/docs/graphs/native.png -- 57.90kb -> 33.67kb (41.85%)
/docs/images/text.png -- 4.95kb -> 2.99kb (39.61%)
/docs/graphs/foundations.png -- 18.19kb -> 11.19kb (38.46%)
/examples/scrollable/screenshot.png -- 144.78kb -> 102.53kb (29.18%)
/examples/svg/resources/tiger.svg -- 67.02kb -> 64.50kb (3.76%)
/docs/logo.svg -- 1.37kb -> 1.35kb (1.57%)
/docs/images/todos_desktop.jpg -- 302.36kb -> 302.33kb (0.01%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2022-02-07 23:13:29 +07:00
Theo Robinson
4830a17d65
Fix links
Change dead links to updated ones.
Change/Convert all file links to relative links so they are branch
agnostic.
2022-02-07 23:13:25 +07:00
Héctor Ramón Jiménez
93285d85b0
Remove ambiguous text_color attributes for Checkbox and Radio
Instead, always use a `StyleSheet`.
2022-01-20 18:34:15 +07:00
Héctor Ramón
f084ed8df1
Merge pull request #1106 from RamType0/RemoveUnnecessaryStringAllocationInExample
Remove unnecessary String allocation
2021-11-10 23:59:35 +07:00
Ram.Type-0
0245f289b2 Remove unnecessary String allocation
Remove unnecessary String allocation by passing &format! or &x.to_string as impl Into<String>
2021-11-02 00:05:25 +09:00
Héctor Ramón Jiménez
eed19dcf81
Reintroduce Box for style_sheet in Scrollable 2021-10-31 17:39:24 +07:00
Héctor Ramón Jiménez
bd7b086ec1
Reintroduce Box for style_sheet in Radio 2021-10-31 17:14:10 +07:00
Héctor Ramón Jiménez
40a5de5811
Reintroduce Box for style_sheet in Container 2021-10-31 17:02:59 +07:00
Héctor Ramón Jiménez
d39ad717ed
Wire up styling to Radio in iced_native 2021-10-20 19:18:40 +07:00
Héctor Ramón Jiménez
d61cb58d92
Wire up container styling to iced_native 2021-10-18 15:36:32 +07:00
Héctor Ramón Jiménez
54a9a232f8
Draw scrollbar in Widget::draw for Scrollable 2021-10-18 14:48:33 +07:00
Héctor Ramón
ce3a5f19b9 Add scrolling progress indicators to scrollable example 2021-06-04 20:46:47 +07:00
Héctor Ramón
57510c43c8 Add buttons to control scrolling in scrollable example 2021-06-04 20:15:06 +07:00
Héctor Ramón
59c2500c55 Fix Scrollable scrollbar being rendered behind contents
... by issuing a new clip layer just for the scrollbar itself.
2021-05-03 15:42:02 +07:00
Héctor Ramón Jiménez
f41eacc3dc Use f32 for border_width and border_radius 2020-11-23 00:31:50 +01:00
Héctor Ramón Jiménez
2ca05520ba Update screenshot of scrollable example 2020-10-24 10:32:26 +02:00
Héctor Ramón Jiménez
ed458d33d9 Reduce contrast of dark theme in scrollable example 2020-10-24 10:29:19 +02:00