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;
20pub mod loaders;
21mod sizing;
22mod strip;
23mod table;
24
25#[cfg(feature = "chrono")]
26pub use crate::datepicker::DatePickerButton;
27
28pub(crate) use crate::layout::StripLayout;
29pub use crate::sizing::Size;
30pub use crate::strip::*;
31pub use crate::table::*;
32
33pub use loaders::install_image_loaders;
34
35// ---------------------------------------------------------------------------
36
37/// Panic in debug builds, log otherwise.
38macro_rules! log_or_panic {
39 ($fmt: literal) => {$crate::log_or_panic!($fmt,)};
40 ($fmt: literal, $($arg: tt)*) => {{
41 if cfg!(debug_assertions) {
42 panic!($fmt, $($arg)*);
43 } else {
44 log::error!($fmt, $($arg)*);
45 }
46 }};
47}
48pub(crate) use log_or_panic;