1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -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

@@ -201,11 +201,12 @@ impl WidgetGallery {
ui.add(egui::Image::new(egui_icon.clone()));
ui.end_row();
ui.add(doc_link_label("ImageButton", "ImageButton"));
ui.add(doc_link_label(
"Button with image",
"Button::image_and_text",
));
if ui
.add(egui::ImageButton::new(
egui::Image::from(egui_icon).max_size(egui::Vec2::splat(16.0)),
))
.add(egui::Button::image_and_text(egui_icon, "Click me!"))
.clicked()
{
*boolean = !*boolean;