Files
craft-libs/crates/ui/src/lib.rs
T
William Dunn bfe246b5b4 craft-ui: leave the menu module ungated, as main has it
This branch gated `pub mod menu;` behind the esign feature, which was right when main had no menu module of its own. #160 landed one, and its cloud pages use it (crates/ui/src/cloud/pages.rs, cloud/title.rs). The gate therefore broke every build with cloud on and esign off, which is what the workspace clippy leg does. The gate was the whole remaining content of the commit that carried the helper across.
2026-11-17 21:04:35 -05:00

51 lines
1.6 KiB
Rust

#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
//! Small, reusable egui components for the Craft frontends.
//!
//! Applications own their assets, themes, layouts, commands and document semantics. Components
//! accept focused style values and return egui responses; no application engine is required.
#[cfg(feature = "share")]
pub mod account;
pub mod backdrop;
pub mod buttons;
pub mod capture;
#[cfg(feature = "cloud")]
pub mod cloud;
pub mod combo;
pub mod direction;
pub mod docking;
#[cfg(feature = "esign")]
pub mod esign;
mod focus;
pub mod fonts;
pub mod icons;
pub mod ime;
pub mod layout;
pub mod localized;
pub mod menu;
pub mod panes;
pub mod presence;
pub mod printing;
pub mod shapes;
#[cfg(feature = "share")]
pub mod share;
pub mod tabs;
#[cfg(all(feature = "screen-testing", not(target_arch = "wasm32")))]
pub mod testing;
pub mod text;
pub mod theme;
pub use combo::ComboBox;
/// Lets one unit test at a time hold a wgpu renderer. Each renderer creates its own Vulkan instance
/// and device. When one test uses its device while a test on another thread creates or destroys
/// one, the Vulkan loader now and then crashes the test binary with SIGSEGV. Take the lock before
/// building the harness (`let _gpu = crate::gpu_test_lock();`), so it is released after the harness
/// is dropped. A test that failed while holding it does not block the others.
#[cfg(test)]
pub(crate) fn gpu_test_lock() -> std::sync::MutexGuard<'static, ()> {
static LOCK: std::sync::Mutex<()> = std::sync::Mutex::new(());
LOCK.lock().unwrap_or_else(std::sync::PoisonError::into_inner)
}