1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 12:50:04 -04:00
Files
egui/crates/egui_extras/src/lib.rs
Lucas Meurer 9150b9342d 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.
2025-09-23 10:07:18 +02:00

49 lines
1.2 KiB
Rust

//! This is a crate that adds some features on top top of [`egui`](https://github.com/emilk/egui).
//!
//! This crate are for experimental features, and features that require big dependencies that does not belong in `egui`.
//!
//! ## Feature flags
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
//!
#![allow(clippy::float_cmp)]
#![allow(clippy::manual_range_contains)]
#[cfg(feature = "chrono")]
mod datepicker;
pub mod syntax_highlighting;
#[doc(hidden)]
pub mod image;
mod layout;
pub mod loaders;
mod sizing;
mod strip;
mod table;
#[cfg(feature = "chrono")]
pub use crate::datepicker::DatePickerButton;
pub(crate) use crate::layout::StripLayout;
pub use crate::sizing::Size;
pub use crate::strip::*;
pub use crate::table::*;
pub use loaders::install_image_loaders;
// ---------------------------------------------------------------------------
/// Panic in debug builds, log otherwise.
macro_rules! log_or_panic {
($fmt: literal) => {$crate::log_or_panic!($fmt,)};
($fmt: literal, $($arg: tt)*) => {{
if cfg!(debug_assertions) {
panic!($fmt, $($arg)*);
} else {
log::error!($fmt, $($arg)*);
}
}};
}
pub(crate) use log_or_panic;