Commit graph

3453 commits

Author SHA1 Message Date
Héctor Ramón Jiménez
faa7627ea4
Introduce web-colors feature flag to enable sRGB linear blending
This is how browsers perform color management. They treat
gamma-corrected sRGB colors as if they were linear RGB.

Correctness aside, this mode is introduced for legacy reasons. Most
UI/UX tooling uses this color management as well, and many have created
an intuition about how color should behave from interacting with a
browser.

This feature flag should facilitate application development with `iced`
in those cases.

More details: https://webcolorisstillbroken.com/
2023-05-31 21:31:58 +02:00
Héctor Ramón
b5f102c558
Merge pull request #1883 from iced-rs/update/glyphon
Skip missing glyphs instead of panicking in `glyphon`
2023-05-30 17:07:24 +02:00
Héctor Ramón
9253f7663d
Merge pull request #1873 from bungoboingo/fix/bg-gradient-layering
[Fix] Quads of different background types not ordered
2023-05-30 01:47:31 +02:00
Héctor Ramón
8ff2e0178f
Merge pull request #1859 from RGBCube/patch-1
Add Nix instructions to README
2023-05-30 01:42:18 +02:00
Héctor Ramón Jiménez
c319f5113b
Move Pipeline struct definition after Layer in quad submodules 2023-05-30 01:35:06 +02:00
Héctor Ramón Jiménez
ef547469fd
Improve boundaries between quad submodules in iced_wgpu 2023-05-30 01:33:50 +02:00
Héctor Ramón Jiménez
5fdc5affce
Rename quad_order variable to kind in quad::Pipeline::render 2023-05-30 01:17:03 +02:00
Héctor Ramón Jiménez
9659e6a848
Improve consistency of match branches in quad::Batch::add 2023-05-30 01:16:30 +02:00
Héctor Ramón Jiménez
cd7d33aa8e
Simplify order match statement in quad::Batch::add 2023-05-30 01:14:41 +02:00
Héctor Ramón Jiménez
6d650e7f99
Rename quad::Order to quad::Kind 2023-05-30 01:08:35 +02:00
Héctor Ramón Jiménez
fe9da174ca
Move layer::quad types to quad module
Not sure why I split these to begin with!
2023-05-30 01:08:34 +02:00
Bingus
eb6c663420
Adjusted Quads struct to be opaque quad::Layer. 2023-05-29 12:24:35 -07:00
Bingus
3f141459a6
Fixed issue where quads of different types were not ordered. 2023-05-29 12:14:11 -07:00
Héctor Ramón
75110b9c0e
Merge pull request #1871 from bungoboingo/fix/bg-gradient
[Fix] Make gradient pack fn public for iced_graphics::Gradient
2023-05-29 21:09:17 +02:00
Héctor Ramón Jiménez
8ca7b884c0
Make Packed fully opaque
... by only allowing direct conversion from our `Gradient` types
2023-05-29 20:56:51 +02:00
Héctor Ramón Jiménez
556f3e89d3
Skip missing glyphs instead of panicking in glyphon 2023-05-29 20:47:47 +02:00
Bingus
902e333148
Changed gradient::Packed to be repr(C) for direct gpu upload. 2023-05-26 10:13:18 -07:00
Héctor Ramón
fcb1b45436
Merge pull request #1875 from clarkmoody/palette-0.7
Upgrade `palette` dependency
2023-05-26 19:02:29 +02:00
Héctor Ramón Jiménez
cf2c8f2037
Use approx for testing color operations 2023-05-26 00:04:10 +02:00
Héctor Ramón Jiménez
b741893013
Use Srgb and Srgba from palette directly 2023-05-26 00:03:34 +02:00
Héctor Ramón Jiménez
2a00aaa747
Use as_slice instead of as_ref in checkbox example 2023-05-25 23:48:42 +02:00
Clark Moody
2d21d0900e
Upgrade palette dependency 2023-05-25 23:44:31 +02:00
Héctor Ramón
c61a4cc21c
Merge pull request #1738 from nicoburns/update-winit-0.28
Update to winit 0.28
2023-05-25 23:37:14 +02:00
Héctor Ramón Jiménez
70fd296ccc
Remove unnecessary newline 2023-05-25 23:20:26 +02:00
Héctor Ramón Jiménez
f0788b9f37
Replace change_always_on_top action with change_level 2023-05-25 23:18:50 +02:00
Héctor Ramón Jiménez
a7fa7e4005
Introduce window::Level enum
... and add `level` field to `window::Settings`
2023-05-25 23:14:07 +02:00
Héctor Ramón Jiménez
b924e86630
Update window_clipboard dependency 2023-05-25 23:05:24 +02:00
Héctor Ramón Jiménez
60d17d68d6
Update winit dependency 2023-05-25 23:04:29 +02:00
Bingus
413526ad09
Created "Packed" data structure for gradient data. 2023-05-25 10:49:26 -07:00
Bingus
a395e78596
Made gradient pack public for iced_graphics::gradient mod for use with GradientVertex2D. 2023-05-24 13:08:59 -07:00
RGBCube
490cc3d558
Update README.md 2023-05-23 21:07:29 +03:00
RGBCube
b74d8dafbf
Create DEPENDENCIES.md 2023-05-23 21:07:08 +03:00
Héctor Ramón
6c6930b91d
Merge pull request #1869 from casperstorm/extend-border-radius
Extended border radius on relevant widgets
2023-05-23 20:03:05 +02:00
Casper Storm
25804d9e5a clean up rebase mistake 2023-05-23 19:42:01 +02:00
Casper Storm
1234d52812 clippy 2023-05-23 15:28:45 +02:00
Casper Storm
1c86defab5 Extend border radius on relevant widgets 2023-05-23 14:50:29 +02:00
Héctor Ramón
8300d86c24
Merge pull request #1844 from tarkah/fix/scrollbar-widths
Remove min width 1 from scrollbar & scroller
2023-05-23 04:53:24 +02:00
Héctor Ramón Jiménez
29326952b4
Avoid drawing empty quads in widget::scrollable 2023-05-23 04:39:41 +02:00
Cory Forsstrom
12a57fae5c
Remove min width 1 from scrollbar & scroller 2023-05-23 04:28:44 +02:00
Héctor Ramón
e31582e59e
Merge pull request #1797 from bbb651/master
Make mouse::Button::Other take u16 instead of u8
2023-05-23 02:52:14 +02:00
bbb651
5802c95797
Make mouse::Button::Other take u16 instead of u8
On wayland keys correspond to <input-event-codes.h>,
and they are past the limit of u8, causing the
back and forward buttons to be 20 and 19 which definitely isn't right
(they should all be around 0x110..=0x117).
2023-05-23 02:35:38 +02:00
Héctor Ramón
f0073e3d71
Merge pull request #1861 from marienz/from-pointers
Support conversion from Fn trait to custom theme
2023-05-23 02:30:46 +02:00
Héctor Ramón
3d354fd337
Merge pull request #1840 from a1phyr/glam
Update `glam` to `0.24`
2023-05-22 20:12:46 +02:00
Benoît du Garreau
dee8ede5be Update glam to 0.24 2023-05-22 17:23:42 +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
RGBCube
039debd251
Add Nix instructions to README 2023-05-20 20:23:00 +03:00
Héctor Ramón
640e13943c
Merge pull request #1856 from jhff/pane_grid_split_with_dragged_pane
[Feature] Enhance PaneGrid to split panes by drag & drop
2023-05-19 17:16:22 +02:00
Joao Freitas
9b5f32ee40
Rename invert -> swap 2023-05-19 12:15:44 +01:00
Joao Freitas
bc590e2d6f
Take pane state internally 2023-05-19 12:12:08 +01:00
Joao Freitas
0cb84c1c4c
Change name of hovered region style struct, reorder lines & export Appearance 2023-05-19 12:02:39 +01:00