mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Make individual egui_extras image loaders public (#7551)
This was initially a PR to add kitdiff, but this now lives in it's own crate: https://github.com/rerun-io/kitdiff I needed to make the image loaders public, this way it's possible to compose image loaders together (which allowed me to create a image diff loader that uses two other image loaders). But you can't use the `ctx.try_load_image` since that would deadlock, so you have to store a reference to the other loader in the wrapping loader.
This commit is contained in:
@@ -17,7 +17,7 @@ pub mod syntax_highlighting;
|
||||
#[doc(hidden)]
|
||||
pub mod image;
|
||||
mod layout;
|
||||
mod loaders;
|
||||
pub mod loaders;
|
||||
mod sizing;
|
||||
mod strip;
|
||||
mod table;
|
||||
|
||||
@@ -63,9 +63,9 @@ pub fn install_image_loaders(ctx: &egui::Context) {
|
||||
}
|
||||
|
||||
#[cfg(feature = "http")]
|
||||
if !ctx.is_loader_installed(self::ehttp_loader::EhttpLoader::ID) {
|
||||
if !ctx.is_loader_installed(self::http_loader::EhttpLoader::ID) {
|
||||
ctx.add_bytes_loader(std::sync::Arc::new(
|
||||
self::ehttp_loader::EhttpLoader::default(),
|
||||
self::http_loader::EhttpLoader::default(),
|
||||
));
|
||||
log::trace!("installed EhttpLoader");
|
||||
}
|
||||
@@ -108,16 +108,16 @@ pub fn install_image_loaders(ctx: &egui::Context) {
|
||||
}
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
mod file_loader;
|
||||
pub mod file_loader;
|
||||
|
||||
#[cfg(feature = "http")]
|
||||
mod ehttp_loader;
|
||||
pub mod http_loader;
|
||||
|
||||
#[cfg(feature = "gif")]
|
||||
mod gif_loader;
|
||||
pub mod gif_loader;
|
||||
#[cfg(feature = "image")]
|
||||
mod image_loader;
|
||||
pub mod image_loader;
|
||||
#[cfg(feature = "svg")]
|
||||
mod svg_loader;
|
||||
pub mod svg_loader;
|
||||
#[cfg(feature = "webp")]
|
||||
mod webp_loader;
|
||||
pub mod webp_loader;
|
||||
|
||||
Reference in New Issue
Block a user