too/view/
mod.rs

1//! Types for implementing and interacting with Ui elements
2pub mod debug;
3
4mod state;
5pub use state::{debug, Debug, DebugMode, State};
6
7mod response;
8pub use response::Response;
9
10mod input;
11pub use input::{EventCtx, Handled, InputState, Interest, ViewEvent};
12
13mod ui;
14pub use ui::Ui;
15
16mod layout;
17pub use layout::{IntrinsicSize, Layer, Layout, LayoutNode, LayoutNodes};
18
19mod render;
20pub use render::{CroppedSurface, Render};
21
22mod view_nodes;
23pub use view_nodes::{ViewNode, ViewNodes};
24
25mod style;
26pub use style::{Elements, Palette, StyleKind};
27
28mod internal_views;
29
30mod adhoc;
31pub use adhoc::Adhoc;
32
33mod builder;
34pub use builder::{Builder, View, ViewExt};
35
36mod erased;
37use erased::Erased;
38
39slotmap::new_key_type! {
40    /// An opaque ID for a [`View`](crate::view::View) in the current UI tree
41    ///
42    /// Nothing is guaranteed about this type.
43    pub struct ViewId;
44}
45
46pub mod test;
47
48// TODO get rid of this
49use crate::math::Size;
50#[inline(always)]
51#[deprecated(note = "don't use this, use Text when its implemented")]
52pub fn measure_text(data: &str) -> Size {
53    use unicode_width::UnicodeWidthStr as _;
54    Size::new(data.width() as f32, 1.0)
55}