* rework loading around `Arc<Loaders>`
* use `Bytes` instead of splitting api
* remove unwraps in `texture_handle`
* make `FileLoader` optional under `file` feature
* hide http load error stack trace from UI
* implement image fit
* support more image sources
* center spinner if we know size ahead of time
* allocate final size for spinner
* improve image format guessing
* remove `ui.image`, `Image`, add `RawImage`
* deprecate `RetainedImage`
* `image2` -> `image`
* add viewer example
* update `examples/image` + remove `svg` and `download_image` exapmles
* fix lints and tests
* fix doc link
* add image controls to `images` example
* add more `From` str-like types
* add api to forget all images
* fix max size
* do not scale original size unless necessary
* fix doc link
* add more docs for `Image` and `RawImage`
* make paint_at `pub`
* update `ImageButton` to use new `Image` API
* fix double rendering
* `SizeHint::Original` -> `Scale` + remove `Option` wrapper
* Update crates/egui/src/load.rs
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* remove special `None` value for `forget`
* Update crates/egui/src/load.rs
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* add more examples to `ui.image` + add `include_image` macro
* Update crates/egui/src/ui.rs
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* update `menu_image_button` to use `ImageSource`
* `OrderedFloat::get` -> `into_inner`
* derive `Eq` on `SizedTexture`
* add `id` to loaders + `is_installed` check
* move `images` to demo + simplify `images` example
* log trace when installing loaders
* fix lint
* fix doc link
* add more documentation
* more `egui_extras::loaders` docs
* Update examples/images/src/main.rs
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* update `images` example screenshots + readme
* remove unused `rfd` from `images` example
* Update crates/egui_extras/src/loaders/ehttp_loader.rs
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* add `must_use` on `Image` and `RawImage`
* document `loaders::install` multiple call safety
* Update crates/egui_extras/Cargo.toml
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* reshuffle `is_loader_installed`
* make `include_image` produce `ImageSource` + update docs
* update `include_image` docs
* remove `None` mentions from loader `forget`
* inline `From` texture id + size for `SizedTexture`
* add warning about statically known path
* change image load error + use in image button
* add `.size()` to `Image`
* Update crates/egui_demo_app/Cargo.toml
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* add explanations to image viewer ui
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* add types from proposal
* add load methods on `egui::Context`
* implement loaders from proposal in `egui_extras`
* impl `From<Vec2>` for `SizeHint`
* re-export `SizeHint` from `egui` root
* rework `svg` example to use new managed `Image`
* split loaders into separate files + add logging
* add `log_trace`
* clean up `RetainedImage` from `svg` example
* refactor ehttp loader response to bytes mapping
* remove spammy trace
* load images even without extension
* fix lints
* remove unused imports
* use `Image2` in `download_image`
* use `visuals.error_fg_color` in `Image2` error state
* update lockfile
* use `Arc<ColorImage>` in `ImageData` + add `forget` API
* add `ui.image2`
* add byte size query api
* use iterators to sum loader byte sizes
* add static image loading
* use static image in `svg` example
* small refactor of `Image2::ui` texture loading code
* add `ImageFit` to size images properly
* remove println calls
* add bad image load to `download_image` example
* add loader file extension support tests
* fix lint errors in `loaders`
* remove unused `poll-promise` dependency
* add some docs to `Image2`
* add some docs to `egui_extras::loaders::install`
* explain `loaders::install` in examples
* fix lint
* upgrade `ehttp` to `0.3` for some crates
* Remove some unused dependencies
* Remove unnecessary context clone
* Turn on the `log` create feature of egui_extras in all examples
* rename `forget` and document it
* derive `Debug` on `SizeHint`
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* round when converting SizeHint from vec2
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* add `load` module docs
* docstring `add_loader` methods
* expose + document `load_include_bytes`
* cache texture handles in `DefaultTextureLoader`
* add `image2` doctest + further document `Image2`
* use `Default` for default `Image2` options
* update `image2` doc comment
* mention immediate-mode safety
* more fit calculation into inherent impl
* add hover text on spinner
* add `all-loaders` feature
* clarify `egui_extras::loaders::install` behavior
* explain how to enable image formats
* properly format `uri`
* use `thread::Builder` instead of `spawn`
* use eq op instead of `matches`
* inline `From<Arc<ColorImage>>` for `ImageData`
* allow non-`'static` bytes + `forget` in `DefaultTextureLoader`
* sort features
* change `ehttp` feature to `http`
* update `Image2` docs
* refactor loader cache type
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Silence a few clippy warnings
* Use named threads
* Remove some deprecated functions
* Document Context and Ui fully
* Use `parking_lot::Mutex` in `eframe`
* Expand clippy.toml files
* build fix
* Bump `wgpu` to 0.17.0
This required bumping wasm-bindgen to 0.2.87
* cargo deny exception for `foreign-types`
* sort deny.toml
* Add fragile-send-sync-non-atomic-wasm feature to wgpu
* cargo deny: ignore children of foreign-types
---------
Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* implement save_plot
* fix for check.sh
* clippy
* add save_plot to Cargo.lock
* adapted for PR #2676 (removes unsafe code)
* add some comments
* implemented the comments from emilk
* update comments in code
* rustfmt
* remove picked_path
* add more comments
* removed unused import
* use `inner.response.rect` as the plot position
* remove plot_location from MyApp members
* sort entries
* Update examples/save_plot/src/main.rs
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* use env_logger instead of tracing subscriber
* use env_logger instead of tracing subscriber and combine if let
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Expose raw window and display handles in eframe
* Ensure that no one implements `Clone` in the future
* Cleanup
---------
Co-authored-by: Matti Virkkunen <mvirkkunen@gmail.com>
* Update accesskit to 0.11
* Add instructions on how to test the web viewer to CONTRIBUTING.md
Also removed dependency on `jq`
Closes https://github.com/emilk/egui/issues/2859
* Detect panics during initialization and show them to the user
* PanicHandler now also logs the panics
* Add example of how to call into your app from JS
* Refactor: break out AppRunner and AppRunnerRef to own files
* Hide AppRunner
* Simplify user code
* AppRunnerRef -> WebRunner
* Better docs
* Don't paint until first animation frame
* Update multiple_apps.html
* Update web demo
* Cleanup and fixes
* left-align panic message in html
* Make wgpu webgl/gles opt-in (but still work out of the box via feature flag), workaround canvas creation issue
* missing allow unsafe code annotations
* add breaking change not to eframe release notes
* Add --webgpu flag to build_demo_web.sh
* Improve CHANGELOG docs
* Clean up, and prepare for having to wasm:s
* put canvas without workaround under `if false`
* fix spelling
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* eframe: Set app icon on Mac and Windows
Also: correctly set window title on Mac when launching from
another process, e.g. python.
Co-authored-by: Wumpf <andreas@rerun.io>
* lint fixes
* Fix web build
* fix typo
* Try fix windows build
---------
Co-authored-by: Wumpf <andreas@rerun.io>
* Refactor repaint logic
* request_repaint_after also fires the request_repaint callback
* Bug fixes
* Add test to egui_demo_app
* build_demo_web: build debug unless --release is specified
* Fix the web backend too
* Run special clippy for wasm, forbidding some types/methods
* Remove wasm_bindgen_check.sh
* Fix typos
* Revert "Remove wasm_bindgen_check.sh"
This reverts commit 92dde25344.
* Only run cranky/clippy once
* add method for requesting attention to the main window
* use another enum member for user attention type instead of nested `Option`s
(also, document the enum members now that they don't mirror `winit`)
* update the docstring
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* add an example app for testing window attention requests
* Apply suggestions from code review
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* remove `chrono` dependency and improve the attention example's readability
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Remove dark-light dependency
Since https://github.com/emilk/egui/pull/2750 we now get what we need
straight from `winit`.
* fix warning
* Docstring formatting
* fix typo in check.sh
* Replace tracing crate with log
It's just so much simpler to use
* Add `bacon wasm` job
* eframe: add a WebLogger for piping log events to the web console
Instead of depending on android-activity directly, this exposes the
android-native-activity and android-game-activity features from Winit.
This ensures that applications can choose what android-backend they use
while also relying on Winit to decide what version of android-activity to
use - without increasing the risk of a version conflict by having a direct
dependency.
_(NB: Egui doesn't currently use the android-activity API itself)_
Since android-activity provides the `android_main()` entry point for
Android applications it's not possible to link in multiple version of
the android-activity crate and so it's particularly important to
avoid unnecessary direct dependencies that could cause a version
conflict in the future.
To help avoid the need for applications to directly depend on
android-activity the Winit crate re-exports the android-activity API
and exposes features to configure the backend so that application crates
can instead rely on Winit to pull in a compatible version of
android-activity. (This way version bumps for android-activity only
need to be synchronized with the Winit crate).
CI now enables the `android-native-activity` feature for testing.
Fixes: #2829Fixes: #2720Closes: #2834
* use glutin-winit for glow context creation
* added some tracing for easier debugging of glutin problems
* fmt
* add more debug logs
* more tracing
* fallback egl instead of prefer egl
* update pure glow example to use glutin_winit
* add more logging. ignore vsync option if not supported
* cranky lint
* add some logging for easier debugging
* drop window after glutin surface
* small changes based on pr review
* build fix
---------
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
* Update resvg, tiny-skia and usv to latest
* Remove default features from svg crates
Users can always opt-in to them themselves
* Update png 0.17.6 -> 0.17.7
* Update to winit 0.28
Mac trackpads pinch gestures will now generate `egui::Event::Zoom`
* Update accesskit_winit
* Try to get Android CI green
* Fix wayland compilation
* Add comment about android-activity
* Update changelogs
* Fix call to register_xlib_error_hook
* Remove native screen reader support
Use the "accesskit" feature flag to `eframe` instead.
[AccessKit](https://github.com/AccessKit/accesskit) is the future.
`tts` was a mess to compile on many platforms, so I no longer want
the native `tts` dependency.
* Update tts to 0.25
* Update changelogs
* Turn on all feature flags for package.metadata.docs.rs
* remove tts from deny.toml skip-tree
* Update web build scripts
* Update deny.toml
* Deprecate egui_glium - looking for new maintainer
egui_glium was the first backend of egui, and it served us well for
a long time, but we have long since moved on to glow and wgpu.
Not egui_glium is holding back an update to latest winit.
Since development on glium has long since been discontinued I will
therefore deprecate egui_glium with this PR.
The code is still there in the repository for a while longer,
but is no longer compiled.
If there is any interest in maintaining egui_glium, then fork it and
make a PR to remove the last egui_glium from this repository.
I will give you publish rights on crates.io.
* update glutin 0.30.2 -> 0.30.3
* cargo update -p backtrace
Updating crates.io index
Updating addr2line v0.17.0 -> v0.19.0
Updating backtrace v0.3.66 -> v0.3.67
Updating gimli v0.26.2 -> v0.27.1
Removing miniz_oxide v0.5.4
Updating object v0.29.0 -> v0.30.3
* cargo deny: allow duplicates of windows-sys, wayland-sys, and nix
* cargo-deny whitelist tiny-skia