1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-03 23:30:04 -04:00

Polish image API (#3338)

* Imoprove docs for callback shapes

* Improve docs for loader traits

* Use snake_case for feature `all_loaders`

* Make loaders publix

* Slightly better error message on image load failure

* Improve image loading error messages

* Use `bytes://` schema for included bytes loader

* Try user loaders first

* Move `image_loading_spinners` to `Visuals`

* Unify and simplify code

* Make the main text of `Button` optional

This largely makes ImageButton obsolete

* Fix docstrings

* Better docs

* typos

* Use the more explicit `egui_extras::install_image_loaders`

* Simplify `Image::paint_at` function
This commit is contained in:
Emil Ernerfeldt
2023-09-14 16:33:10 +02:00
committed by GitHub
parent e367c20779
commit d7d222d3f6
25 changed files with 406 additions and 279 deletions

View File

@@ -27,7 +27,7 @@ all-features = true
default = ["dep:mime_guess"]
## Shorthand for enabling the different types of image loaders (`file`, `http`, `image`, `svg`).
all-loaders = ["file", "http", "image", "svg"]
all_loaders = ["file", "http", "image", "svg"]
## Enable [`DatePickerButton`] widget.
datepicker = ["chrono"]
@@ -38,6 +38,14 @@ file = ["dep:mime_guess"]
## Add support for loading images via HTTP.
http = ["dep:ehttp"]
## Add support for loading images with the [`image`](https://docs.rs/image) crate.
##
## You also need to ALSO opt-in to the image formats you want to support, like so:
## ```toml
## image = { version = "0.24", features = ["jpeg", "png"] }
## ```
image = ["dep:image"]
## Enable profiling with the [`puffin`](https://docs.rs/puffin) crate.
##
## Only enabled on native, because of the low resolution (1ms) of clocks in browsers.
@@ -71,12 +79,6 @@ chrono = { version = "0.4", optional = true, default-features = false, features
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
## Add support for loading images with the [`image`](https://docs.rs/image) crate.
##
## You also need to ALSO opt-in to the image formats you want to support, like so:
## ```toml
## image = { version = "0.24", features = ["jpeg", "png"] }
## ```
image = { version = "0.24", optional = true, default-features = false }
# file feature