egui_extras/
lib.rs

1//! This is a crate that adds some features on top top of [`egui`](https://github.com/emilk/egui).
2//!
3//! This crate are for experimental features, and features that require big dependencies that does not belong in `egui`.
4//!
5//! ## Feature flags
6#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
7//!
8
9#![allow(clippy::float_cmp)]
10#![allow(clippy::manual_range_contains)]
11
12#[cfg(feature = "chrono")]
13mod datepicker;
14
15pub mod syntax_highlighting;
16
17#[doc(hidden)]
18pub mod image;
19mod layout;
20mod loaders;
21mod sizing;
22mod strip;
23mod table;
24
25#[cfg(feature = "chrono")]
26pub use crate::datepicker::DatePickerButton;
27
28#[doc(hidden)]
29#[allow(deprecated)]
30pub use crate::image::RetainedImage;
31pub(crate) use crate::layout::StripLayout;
32pub use crate::sizing::Size;
33pub use crate::strip::*;
34pub use crate::table::*;
35
36pub use loaders::install_image_loaders;
37
38// ---------------------------------------------------------------------------
39
40/// Panic in debug builds, log otherwise.
41macro_rules! log_or_panic {
42    ($fmt: literal) => {$crate::log_or_panic!($fmt,)};
43    ($fmt: literal, $($arg: tt)*) => {{
44        if cfg!(debug_assertions) {
45            panic!($fmt, $($arg)*);
46        } else {
47            log::error!($fmt, $($arg)*);
48        }
49    }};
50}
51pub(crate) use log_or_panic;