1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Standard widgets for `densa_ui`: [`Label`], [`Button`], [`TextInput`] (with undo and the
//! clipboard), [`ScrollView`], [`Splitter`], [`Panel`], [`DockArea`] (panels in tab groups
//! the user rearranges, the arrangement saved and restored as a [`DockLayout`]),
//! [`DataGrid`] (rows of a model, scrolled, selected, copied and sorted), [`Chart`] (time
//! series, candles and volume, panned and zoomed), and [`Menu`] and [`MenuBar`] (commands in
//! menus that pop up, with submenus, check marks and keyboard navigation).
//!
//! Each is a [`Widget`](densa_ui::Widget): add it to a [`Ui`](densa_ui::Ui) with a
//! [`Style`](densa_ui::Style), and read what the user did from the actions it reports.
//! They take their colors and text size from the [`Theme`](densa_ui::Theme), and paint and
//! handle input without allocating (editing text re-lays it out, which does).
//!
//! ```
//! use densa_core::Size;
//! use densa_paragraph::TextSystem;
//! use densa_ui::{Align, Style, Ui};
//! use densa_widgets::{Button, Label, Panel, TextInput};
//!
//! let mut ui = Ui::new(TextSystem::new()?);
//! ui.resize(Size::new(640.0, 480.0));
//! let bar = ui.add(
//! ui.root(),
//! Panel::new(),
//! Style::row().gap(6.0).padding(8.0).align_items(Align::Center),
//! )?;
//! ui.add(bar, Label::new("Symbol"), Style::row())?;
//! let filter = ui.add(bar, TextInput::new("").with_placeholder("Filter"), Style::row())?;
//! let run = ui.add(bar, Button::new("Run").primary(), Style::row())?;
//! ui.layout();
//! assert!(ui.rect(run).unwrap().left() > ui.rect(filter).unwrap().right());
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
pub use Button;
pub use Chart;
pub use ;
pub use DataGrid;
pub use Label;
pub use ;
pub use Panel;
pub use ScrollView;
pub use Splitter;
pub use TextInput;