Commit Graph

9 Commits

Author SHA1 Message Date
Jan Procházka 67a3fcae38
Final polish for new image loading (#3328)
* add egui logo to widget gallery

* improve "no image loaders" error message

* rework static URIs to accept `Cow<'static>`

* remove `RetainedImage` from `http_app` in `egui_demo_app`

* hide `RetainedImage` from docs

* use `ui.image`/`Image` over `RawImage`

* remove last remanant of `RawImage`

* remove unused doc link

* add style option to disable image spinners

* use `Into<Image>` instead of `Into<ImageSource>` to allow configuring the underlying image

* propagate `image_options` through `ImageButton`

* calculate image size properly in `Button`

* properly calculate size in `ImageButton`

* Update crates/egui/src/widgets/image.rs

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>

* improve no image loaders error message

* add `size()` helper to `TexturePoll`

* try get size from poll in `Button`

* add `paint_at` to `Spinner`

* use `Spinner::paint_at` and hover on image button response

* `show_spinner` -> `show_loading_spinner`

* avoid `allocate_ui` in `Image` when painting spinner

* make icon smaller + remove old texture

* add `load_and_calculate_size` + expose `paint_image_at`

* update `egui_plot` to paint image in the right place

* Add helpers for painting an ImageSource directly

* Use max_size=INF as default

* Use new API in WidgetGallery

* Make egui_demo_app work by default

* Remove Option from scale

* Refactor ImageSize

* Fix docstring

* Small refactor

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2023-09-13 16:27:08 +02:00
Emil Ernerfeldt 3c4223c6b1
Support images with rounded corners (#3257)
* Add `Rect::ZERO`

* Add `Rounding::ZERO`

* Add `RectShape::new`

* Add `Image::rounding` to support images with rounded corners
2023-08-15 09:29:30 +02:00
Emil Ernerfeldt 6633ecce64
Fix wrong detection of OS (#3238)
We had a bunch of `cfg!(windows)` and `cfg!(macos)` which should
have been `cfg!(target_os = "windows")`.

I wonder what the effects of this PR will be fore Windows 😬
2023-08-12 13:50:31 +02:00
Emil Ernerfeldt 34e6e12f00
Specify deifferent minification and magnification filters (#2224)
* Specify deifferent minification and magnification filters

* Fixes

* Update changelogs

* Doctest fixes

* Add deprecation notice for RetainedImage::with_texture_filter
2022-11-02 17:54:06 +01:00
Emil Ernerfeldt eba3927ace
Remove .with_srgb(false) when constructing window (#2110) 2022-10-08 11:43:48 +02:00
Emil Ernerfeldt 4ac1e28eae
Improve text redering and do all color operation in gamma space (#2071) 2022-09-24 17:53:11 +02:00
Emil Ernerfeldt ac4d75e9b4
egui-winit: don't repaint when just moving window (#1980)
* Bug fix: reset repaint countdown when we pass it

* eframe: debug-print what winit event caused a repaint

* egui-winit: don't repaint when only moving window

* fix docstring
2022-08-29 11:20:19 +02:00
Tomáš Král f3f6946eb2
`egui_glium` correct texture filtering (#1962)
* correct texture filter in egui_glium

* update example

* cargo fmt

* rename UserTexture
2022-08-25 08:05:58 +02:00
Emil Ernerfeldt 041f2e64ba
Move all crates into a `crates` directory (#1940) 2022-08-20 10:41:49 +02:00