2022-02-21 14:26:26 +00:00
//! 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`.
#![ allow(clippy::float_cmp) ]
#![ allow(clippy::manual_range_contains) ]
2022-03-31 19:13:25 +00:00
#[ cfg(feature = " chrono " ) ]
mod datepicker ;
2022-02-21 14:26:26 +00:00
pub mod image ;
2022-03-31 19:13:25 +00:00
mod layout ;
mod sizing ;
mod strip ;
mod table ;
#[ cfg(feature = " chrono " ) ]
pub use crate ::datepicker ::DatePickerButton ;
2022-02-21 14:26:26 +00:00
pub use crate ::image ::RetainedImage ;
2022-03-31 19:13:25 +00:00
pub ( crate ) use crate ::layout ::StripLayout ;
pub use crate ::sizing ::Size ;
pub use crate ::strip ::* ;
pub use crate ::table ::* ;
2022-04-11 12:27:32 +00:00
/// Log an error with either `tracing` or `eprintln`
macro_rules ! log_err {
( $fmt : literal , $( $arg : tt ) * ) = > { {
#[ cfg(feature = " tracing " ) ]
tracing ::error! ( $fmt , $( $arg ) * ) ;
#[ cfg(not(feature = " tracing " )) ]
eprintln! (
concat! ( " egui_extras: " , $fmt ) , $( $arg ) *
) ;
} } ;
}
2022-04-25 20:01:32 +00:00
pub ( crate ) use log_err ;
2022-04-11 12:27:32 +00:00
/// Panic in debug builds, log otherwise.
macro_rules ! log_or_panic {
( $fmt : literal , $( $arg : tt ) * ) = > { {
if cfg! ( debug_assertions ) {
panic! ( $fmt , $( $arg ) * ) ;
} else {
$crate ::log_err! ( $fmt , $( $arg ) * ) ;
}
} } ;
}
2022-04-25 20:01:32 +00:00
pub ( crate ) use log_or_panic ;